/* ─────────────────────────────────────────────────────────────────────
   GALAXY EXPRESS — DESIGN SYSTEM
   Premium unified commerce platform design tokens & utilities
───────────────────────────────────────────────────────────────────── */

:root {
  /* ── Brand Colors ── */
  --lime-50:  #f7ffe6;
  --lime-100: #eeffcc;
  --lime-200: #d5ff94;
  --lime-300: #b5f548;
  --lime-400: #9be522;
  --lime-500: #7dcb06;
  --lime-600: #5ea200;
  --lime-700: #487a02;
  --lime-800: #3a6105;
  --lime-900: #2f5009;

  --forest-50:  #f0fdf4;
  --forest-100: #dcfce7;
  --forest-200: #bbf7d0;
  --forest-300: #86efac;
  --forest-400: #4ade80;
  --forest-500: #22c55e;
  --forest-600: #16a34a;
  --forest-700: #15803d;
  --forest-800: #166534;
  --forest-900: #14532d;

  /* ── Neutrals ── */
  --gray-0:   #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-150: #e8edf3;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --gray-950: #020617;

  /* ── Dark ── */
  --dark-bg:      #080e14;
  --dark-surface: #0d1520;
  --dark-card:    #111d2e;
  --dark-border:  #1a2d44;
  --dark-border2: #22384f;

  /* ── Semantic ── */
  --primary:       var(--lime-500);
  --primary-dark:  var(--lime-600);
  --primary-light: var(--lime-300);
  --secondary:     var(--forest-600);
  --accent:        #a3e635;

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --purple:  #8b5cf6;
  --orange:  #f97316;
  --pink:    #ec4899;
  --cyan:    #06b6d4;

  /* ── Typography ── */
  --font-base:    'Inter', -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* ── Spacing ── */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* ── Radius ── */
  --r-sm:   0.375rem;
  --r-md:   0.625rem;
  --r-lg:   0.875rem;
  --r-xl:   1.125rem;
  --r-2xl:  1.5rem;
  --r-3xl:  2rem;
  --r-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl: 0 16px 50px rgba(0,0,0,.20), 0 8px 20px rgba(0,0,0,.10);
  --shadow-glow-lime:   0 0 30px rgba(125,203,6,.25), 0 0 60px rgba(125,203,6,.10);
  --shadow-glow-green:  0 0 30px rgba(22,163,74,.20);

  /* ── Transitions ── */
  --ease-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Z-Index ── */
  --z-base:    0;
  --z-above:   10;
  --z-dropdown:100;
  --z-sticky:  200;
  --z-overlay: 300;
  --z-modal:   400;
  --z-toast:   500;
  --z-max:     9999;

  /* ── Sidebar ── */
  --sidebar-w:      260px;
  --sidebar-w-collapsed: 68px;
  --topbar-h:       64px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-base);
  background: var(--dark-bg);
  color: var(--gray-100);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a { text-decoration: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark-surface); }
::-webkit-scrollbar-thumb { background: var(--dark-border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ── Typography Utilities ── */
.font-display { font-family: var(--font-display); }
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.text-5xl   { font-size: var(--text-5xl); }
.text-6xl   { font-size: var(--text-6xl); }

.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black    { font-weight: 900; }

.text-primary   { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-info      { color: var(--info); }
.text-muted     { color: var(--gray-500); }
.text-dim       { color: var(--gray-600); }
.text-white     { color: #fff; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.leading-tight { line-height: 1.3; }
.leading-snug  { line-height: 1.45; }

/* ── Layout ── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.flex-1  { flex: 1 1 0%; }
.flex-none { flex: none; }
.shrink-0  { flex-shrink: 0; }
.grow      { flex-grow: 1; }

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

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-h-screen { min-height: 100vh; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }

/* ── Spacing ── */
.p-1  { padding: var(--sp-1); }
.p-2  { padding: var(--sp-2); }
.p-3  { padding: var(--sp-3); }
.p-4  { padding: var(--sp-4); }
.p-5  { padding: var(--sp-5); }
.p-6  { padding: var(--sp-6); }
.p-8  { padding: var(--sp-8); }
.px-2 { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.px-3 { padding-left: var(--sp-3); padding-right: var(--sp-3); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.px-6 { padding-left: var(--sp-6); padding-right: var(--sp-6); }
.px-8 { padding-left: var(--sp-8); padding-right: var(--sp-8); }
.py-1 { padding-top: var(--sp-1); padding-bottom: var(--sp-1); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-3 { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
.py-6 { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.pt-4 { padding-top: var(--sp-4); }
.pt-8 { padding-top: var(--sp-8); }
.pb-4 { padding-bottom: var(--sp-4); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ── Border Radius ── */
.rounded     { border-radius: var(--r-sm); }
.rounded-md  { border-radius: var(--r-md); }
.rounded-lg  { border-radius: var(--r-lg); }
.rounded-xl  { border-radius: var(--r-xl); }
.rounded-2xl { border-radius: var(--r-2xl); }
.rounded-full { border-radius: var(--r-full); }

/* ── Borders ── */
.border      { border: 1px solid var(--dark-border); }
.border-2    { border: 2px solid var(--dark-border); }
.border-top  { border-top: 1px solid var(--dark-border); }
.border-bottom { border-bottom: 1px solid var(--dark-border); }
.border-primary { border-color: var(--primary); }
.border-success { border-color: var(--success); }
.border-danger  { border-color: var(--danger); }

/* ── Shadow ── */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ── Opacity ── */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ── Transitions ── */
.transition     { transition: all var(--ease-normal); }
.transition-fast { transition: all var(--ease-fast); }

/* ── Backgrounds ── */
.bg-dark     { background: var(--dark-bg); }
.bg-surface  { background: var(--dark-surface); }
.bg-card     { background: var(--dark-card); }
.bg-primary  { background: var(--primary); }
.bg-success  { background: var(--success); }
.bg-warning  { background: var(--warning); }
.bg-danger   { background: var(--danger); }
.bg-info     { background: var(--info); }

/* ─────────────────────────────────────
   BUTTON SYSTEM
───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--r-lg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--ease-normal);
  white-space: nowrap;
  font-family: var(--font-base);
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: var(--text-base); }
.btn-xl { padding: 1.125rem 2.25rem; font-size: var(--text-lg); border-radius: var(--r-xl); }
.btn-icon { padding: 0.625rem; width: 38px; height: 38px; }
.btn-icon.btn-sm { width: 32px; height: 32px; padding: 0.375rem; }
.btn-icon.btn-lg { width: 46px; height: 46px; padding: 0.75rem; }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--lime-500), var(--lime-600));
  color: var(--gray-900);
  border-color: var(--lime-500);
  box-shadow: 0 2px 12px rgba(125,203,6,.30);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--lime-400), var(--lime-500));
  box-shadow: 0 4px 20px rgba(125,203,6,.45);
  transform: translateY(-1px);
}

/* Secondary / Forest */
.btn-secondary {
  background: linear-gradient(135deg, var(--forest-600), var(--forest-700));
  color: #fff;
  border-color: var(--forest-600);
  box-shadow: 0 2px 12px rgba(22,163,74,.20);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, var(--forest-500), var(--forest-600));
  box-shadow: 0 4px 20px rgba(22,163,74,.35);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--gray-300);
  border-color: var(--dark-border2);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-color: var(--gray-500);
}

/* Outline Primary */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: rgba(125,203,6,.10);
  box-shadow: 0 0 20px rgba(125,203,6,.15);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border-color: #ef4444;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
  transform: translateY(-1px);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  border-color: var(--success);
}

/* Disabled */
.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Ripple effect ── */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.10);
  opacity: 0;
  border-radius: inherit;
  transition: opacity var(--ease-fast);
}
.btn:active::after { opacity: 1; }

/* ─────────────────────────────────────
   CARD SYSTEM
───────────────────────────────────── */
.card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  transition: all var(--ease-normal);
}
.card:hover { border-color: var(--dark-border2); }
.card-hover:hover {
  border-color: rgba(125,203,6,.30);
  box-shadow: 0 8px 30px rgba(0,0,0,.20), 0 0 0 1px rgba(125,203,6,.15);
  transform: translateY(-2px);
}
.card-sm { padding: var(--sp-4); border-radius: var(--r-lg); }
.card-glass {
  background: rgba(17,29,46,.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08);
}
.card-primary {
  background: linear-gradient(135deg, rgba(125,203,6,.15), rgba(22,163,74,.10));
  border-color: rgba(125,203,6,.30);
}

/* ─────────────────────────────────────
   BADGE / CHIP
───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-primary { background: rgba(125,203,6,.15); color: var(--lime-400); border: 1px solid rgba(125,203,6,.25); }
.badge-success { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.badge-warning { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.badge-danger  { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.badge-info    { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.25); }
.badge-purple  { background: rgba(139,92,246,.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,.25); }
.badge-gray    { background: rgba(100,116,139,.15); color: var(--gray-400); border: 1px solid rgba(100,116,139,.25); }

/* ─────────────────────────────────────
   INPUT SYSTEM
───────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.input-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-300);
}
.input {
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--dark-border2);
  border-radius: var(--r-lg);
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  color: var(--gray-100);
  transition: all var(--ease-normal);
  width: 100%;
  outline: none;
}
.input::placeholder { color: var(--gray-600); }
.input:focus {
  border-color: var(--primary);
  background: rgba(125,203,6,.05);
  box-shadow: 0 0 0 3px rgba(125,203,6,.12);
}
.input:disabled { opacity: 0.45; cursor: not-allowed; }
.input-lg { padding: 0.875rem 1.25rem; font-size: var(--text-base); }
.input-sm { padding: 0.375rem 0.75rem; font-size: var(--text-xs); }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper .input { padding-left: 2.5rem; }
.input-icon-left {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}
.select {
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--dark-border2);
  border-radius: var(--r-lg);
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  color: var(--gray-100);
  transition: all var(--ease-normal);
  width: 100%;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(125,203,6,.12); }

/* ─────────────────────────────────────
   TABLE SYSTEM
───────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--dark-border);
  border-radius: var(--r-xl);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
}
.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--gray-200);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr { transition: background var(--ease-fast); }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.table tr.selected { background: rgba(125,203,6,.07); }

/* ─────────────────────────────────────
   MODAL SYSTEM
───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 200ms ease;
}
.modal {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xl);
}
.modal-lg { max-width: 820px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}
.modal-title { font-size: var(--text-xl); font-weight: 700; }
.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: all var(--ease-fast);
}
.modal-close:hover { background: rgba(255,255,255,.08); color: var(--gray-200); }

/* ─────────────────────────────────────
   TOAST SYSTEM
───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 380px;
}
.toast {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--r-xl);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  box-shadow: var(--shadow-xl);
  animation: slideLeft 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info    { border-left: 3px solid var(--info); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: var(--text-sm); }
.toast-message { font-size: var(--text-xs); color: var(--gray-400); margin-top: 2px; }

/* ─────────────────────────────────────
   SIDEBAR NAVIGATION
───────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--dark-surface);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  transition: width var(--ease-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-logo {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-logo-mark {
  width: 36px; height: 36px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--lime-500), var(--forest-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-lime);
}
.sidebar-logo-text { font-family: var(--font-display); font-weight: 800; font-size: var(--text-base); color: #fff; white-space: nowrap; }
.sidebar-logo-sub  { font-size: var(--text-xs); color: var(--gray-500); white-space: nowrap; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--sp-3) 0; }
.sidebar-section { padding: var(--sp-2) var(--sp-4) var(--sp-1); }
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-600);
  white-space: nowrap;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.55rem var(--sp-4);
  margin: 1px var(--sp-3);
  border-radius: var(--r-lg);
  color: var(--gray-400);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
  position: relative;
}
.sidebar-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--gray-100);
}
.sidebar-item.active {
  background: rgba(125,203,6,.12);
  color: var(--lime-400);
  font-weight: 600;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
}
.sidebar-item-icon { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-item-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--dark-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--lime-500), var(--forest-600));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--gray-900);
  flex-shrink: 0;
}
.sidebar-user-name  { font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.sidebar-user-role  { font-size: var(--text-xs); color: var(--gray-500); white-space: nowrap; }

/* ─────────────────────────────────────
   TOPBAR
───────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  height: var(--topbar-h);
  background: rgba(8,14,20,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  z-index: var(--z-sticky);
  transition: left var(--ease-slow);
}
.topbar.sidebar-collapsed { left: var(--sidebar-w-collapsed); }
.topbar-breadcrumb { flex: 1; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); color: var(--gray-500); }
.topbar-breadcrumb .current { color: var(--gray-200); font-weight: 600; }
.topbar-search {
  width: 260px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid var(--dark-border);
  border-radius: var(--r-lg);
  padding: 0.45rem 0.875rem 0.45rem 2.25rem;
  font-size: var(--text-sm);
  color: var(--gray-200);
  outline: none;
  transition: all var(--ease-normal);
}
.topbar-search:focus { border-color: var(--primary); background: rgba(125,203,6,.05); width: 320px; }
.topbar-search::placeholder { color: var(--gray-600); }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: 1.1rem;
  position: relative;
  transition: all var(--ease-fast);
}
.topbar-btn:hover { background: rgba(255,255,255,.08); color: var(--gray-200); }
.topbar-btn .notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: var(--r-full);
  border: 1.5px solid var(--dark-bg);
}

/* ─────────────────────────────────────
   MAIN CONTENT AREA
───────────────────────────────────── */
.main-layout {
  min-height: 100vh;
  background: var(--dark-bg);
}
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: var(--sp-6);
  transition: margin-left var(--ease-slow);
  min-height: calc(100vh - var(--topbar-h));
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-w-collapsed); }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
}
.page-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; color: #fff; }
.page-subtitle { font-size: var(--text-sm); color: var(--gray-500); margin-top: var(--sp-1); }

/* ─────────────────────────────────────
   STAT CARDS
───────────────────────────────────── */
.stat-grid { display: grid; gap: var(--sp-4); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: all var(--ease-normal);
}
.stat-card:hover {
  border-color: var(--dark-border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lime-500), var(--forest-600));
  opacity: 0;
  transition: opacity var(--ease-normal);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: var(--sp-4);
}
.stat-icon-lime   { background: rgba(125,203,6,.12); }
.stat-icon-green  { background: rgba(16,185,129,.12); }
.stat-icon-blue   { background: rgba(59,130,246,.12); }
.stat-icon-purple { background: rgba(139,92,246,.12); }
.stat-icon-orange { background: rgba(249,115,22,.12); }
.stat-icon-pink   { background: rgba(236,72,153,.12); }
.stat-icon-cyan   { background: rgba(6,182,212,.12); }
.stat-icon-red    { background: rgba(239,68,68,.12); }
.stat-value { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 800; color: #fff; margin-bottom: var(--sp-1); }
.stat-label { font-size: var(--text-sm); color: var(--gray-500); font-weight: 500; }
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--sp-2);
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.stat-change.up   { background: rgba(16,185,129,.12); color: var(--success); }
.stat-change.down { background: rgba(239,68,68,.12); color: var(--danger); }

/* ─────────────────────────────────────
   CHART PLACEHOLDER
───────────────────────────────────── */
.chart-container {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  position: relative;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}
.chart-title { font-weight: 700; font-size: var(--text-base); }

/* ─────────────────────────────────────
   STATUS INDICATORS
───────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--gray-600); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-dot.danger  { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ─────────────────────────────────────
   TABS
───────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.04);
  border-radius: var(--r-xl);
  padding: 4px;
  border: 1px solid var(--dark-border);
}
.tab {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--r-lg);
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
}
.tab:hover { color: var(--gray-200); }
.tab.active {
  background: var(--dark-card);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────
   DROPDOWN
───────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--r-xl);
  padding: var(--sp-2);
  min-width: 200px;
  z-index: var(--z-dropdown);
  box-shadow: var(--shadow-xl);
  animation: fadeIn 150ms ease;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.55rem var(--sp-3);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  color: var(--gray-300);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.dropdown-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.dropdown-item.danger:hover { background: rgba(239,68,68,.10); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--dark-border); margin: var(--sp-2) 0; }

/* ─────────────────────────────────────
   PROGRESS BARS
───────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--lime-500), var(--lime-400));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

/* ─────────────────────────────────────
   ANIMATIONS
───────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes glow {
  0%,100% { box-shadow: 0 0 20px rgba(125,203,6,.3); }
  50%      { box-shadow: 0 0 40px rgba(125,203,6,.6); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-spin  { animation: spin 1s linear infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow  { animation: glow 2s ease-in-out infinite; }
.animate-count { animation: countUp 0.6s ease both; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--dark-card) 25%, var(--dark-border) 50%, var(--dark-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

/* ─────────────────────────────────────
   CHIP / TAG
───────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--dark-border2);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-300);
  cursor: default;
  white-space: nowrap;
}

/* ─────────────────────────────────────
   AVATAR GROUP
───────────────────────────────────── */
.avatar-group { display: flex; }
.avatar-group .avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  border: 2px solid var(--dark-card);
  margin-left: -8px;
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-900);
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ─────────────────────────────────────
   EMPTY STATE
───────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
}
.empty-state-icon {
  width: 80px; height: 80px;
  border-radius: var(--r-2xl);
  background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin-bottom: var(--sp-6);
  border: 1px solid var(--dark-border);
}
.empty-state-title { font-size: var(--text-xl); font-weight: 700; color: var(--gray-200); margin-bottom: var(--sp-2); }
.empty-state-desc  { font-size: var(--text-sm); color: var(--gray-500); max-width: 360px; margin-bottom: var(--sp-6); }

/* ─────────────────────────────────────
   RESPONSIVE
───────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .topbar, .main-content { left: 0; margin-left: 0; }
  .stat-grid-4, .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-4, .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stat-grid-4, .stat-grid-3, .stat-grid-2 { grid-template-columns: 1fr; }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .modal { padding: var(--sp-6); }
}
