/* =========================================
   ALFA PREMIUM — Zamonaviy dizayn tizimi (v2)
   Indigo/binafsha asosiy rang + issiq gradient urg'u,
   yumshoq soyalar, katta radius — neo-brutalism o'rnida.
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --accent: #fb7185;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #fb7185 100%);
  --secondary: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #38bdf8;

  --bg: #0a0e1a;
  --surface: #141a2e;
  --surface2: #1b2238;
  --text: #f1f5f9;
  --muted: #8b93a7;
  --border: #262f47;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 32px; --space-6: 48px;

  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.25);
  --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.35);
  --shadow-lg: 0 16px 48px rgba(2, 6, 23, 0.45);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 8px 24px rgba(99, 102, 241, 0.18);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.light {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface2: #f1f3f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e6e8f2;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(99, 102, 241, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.12), transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(251, 113, 133, 0.08), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
::selection { background: var(--primary); color: #fff; }

/* =========================================
   Tugmalar
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.2s var(--ease), opacity 0.15s var(--ease);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: 0.1px;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  color: var(--text);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35); }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-secondary:hover { background: var(--surface); border-color: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-success { background: var(--secondary); color: #04281c; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface2); box-shadow: none; transform: none; }
.btn-glass { background: rgba(99, 102, 241, 0.12); color: var(--primary-light); border-color: rgba(99, 102, 241, 0.3); }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs { padding: 6px 12px; font-size: 11px; border-radius: var(--radius-sm); }

/* =========================================
   Header
   ========================================= */
.header { position: sticky; top: 0; z-index: 100; padding: 16px 0; background: rgba(10, 14, 26, 0.72); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
body.light .header { background: rgba(247, 248, 252, 0.75); }
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: #fff; font-size: 18px;
  box-shadow: var(--shadow-glow);
}
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.logo-badge { font-size: 10px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

/* Qidiruv */
.search-box { flex: 1; max-width: 400px; position: relative; }
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface2);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.search-box input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.search-box > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.search-clear { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; display: none; font-size: 12px; }
.search-clear.active { display: block; }

.search-results {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); max-height: 400px; overflow-y: auto; z-index: 1000;
  display: none;
}
.search-results.active { display: block; animation: fadeInUp 0.2s var(--ease); }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.search-result-item:hover { background: var(--surface2); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item img { width: 40px; height: 40px; object-fit: cover; background: var(--surface2); border-radius: var(--radius-sm); }
.search-result-item .info { flex: 1; min-width: 0; }
.search-result-item .name { font-weight: 600; font-size: 13px; }
.search-result-item .price { color: var(--primary-light); font-weight: 700; font-size: 12px; }

/* Header tugmalari */
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  position: relative; font-size: 15px;
}
.icon-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: var(--radius-pill); border: 2px solid var(--surface);
}
.user-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient); color: #fff;
  font-weight: 700; display: grid; place-items: center;
  cursor: pointer; font-size: 15px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s var(--ease);
}
.user-avatar:hover { transform: translateY(-1px); }

/* Balans */
.header-balance {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.header-balance:hover { transform: translateY(-1px); }
.header-balance i { font-size: 14px; }

/* =========================================
   Hero
   ========================================= */
.hero {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.18); color: #fff;
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 700; line-height: 1.1; margin-bottom: 16px; }
.hero p { font-size: 16px; max-width: 420px; margin-bottom: 28px; font-weight: 500; opacity: 0.92; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-buttons .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-md); }
.hero-buttons .btn-secondary { background: rgba(255, 255, 255, 0.15); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.hero-stats { display: flex; gap: 32px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.hero-stat .value { font-size: 32px; font-weight: 700; margin-bottom: 2px; }
.hero-stat .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; opacity: 0.85; }

/* =========================================
   Katalog
   ========================================= */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.section-title { font-size: 28px; font-weight: 700; }
.section-subtitle { color: var(--muted); font-size: 14px; margin-top: 4px; }
.categories-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.category-pill {
  padding: 8px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text); font-weight: 600; font-size: 12px;
  cursor: pointer; transition: all 0.2s var(--ease);
}
.category-pill:hover { border-color: var(--primary-light); }
.category-pill.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* Filtrlar */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.filters-bar .form-select {
  width: auto;
  min-width: 180px;
  padding: 8px 12px;
  font-size: 12px;
}

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.product-image { height: 180px; background: var(--surface2); position: relative; cursor: pointer; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(10, 14, 26, 0.65); color: #fff;
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 600;
}
.favorite-btn {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(10, 14, 26, 0.5); border: none; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center;
  color: #fff; transition: all 0.2s var(--ease);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.favorite-btn:hover { background: var(--danger); transform: scale(1.1); }
.favorite-btn.active { background: var(--danger); color: #fff; }
.product-info { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-weight: 600; font-size: 16px; margin-bottom: 6px; cursor: pointer; line-height: 1.3; }
.product-name:hover { color: var(--primary-light); }
.product-desc { color: var(--muted); font-size: 12px; margin-bottom: 12px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.product-price { font-size: 20px; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.product-actions { display: flex; gap: 8px; }
.product-actions .btn { flex: 1; }

/* Skeleton: mahsulot/jadval yuklanmoqda holati */
.skeleton { position: relative; overflow: hidden; background: var(--surface2); border-radius: var(--radius-sm); }
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}
body.light .skeleton::after { background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.06), transparent); }
.skeleton-card { height: 320px; border-radius: var(--radius-lg); }
.skeleton-row { height: 48px; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* =========================================
   Profil
   ========================================= */
.user-profile {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 100vw;
  background: var(--surface); z-index: 2000;
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideInRight 0.25s var(--ease);
}
.profile-header { padding: 24px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.profile-avatar {
  width: 56px; height: 56px;
  background: var(--gradient); color: #fff;
  font-weight: 700; font-size: 22px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
}
.profile-name { font-weight: 700; font-size: 16px; }
.profile-phone { color: var(--muted); font-size: 13px; }
.profile-balance-card {
  margin: 16px 20px; padding: 20px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(52, 211, 153, 0.06));
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-md);
}
.profile-referral-card {
  margin: 0 20px 16px; padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.profile-menu { padding: 0 20px; flex: 1; overflow-y: auto; }
.profile-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-weight: 600; color: var(--text);
  font-size: 14px; transition: color 0.15s, padding-left 0.15s;
}
.profile-menu-item:hover { color: var(--primary-light); padding-left: 8px; }
.profile-menu-item i:first-child { width: 20px; text-align: center; font-size: 16px; color: var(--primary-light); }

/* =========================================
   Modallar
   ========================================= */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 8, 16, 0.65);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 3000; padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.22s var(--ease);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 19px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--surface2); border-radius: 50%;
  color: var(--text); cursor: pointer; display: grid; place-items: center;
  font-size: 14px; transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--danger); color: #fff; }

/* =========================================
   Formalar
   ========================================= */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text);
  font-size: 14px; font-family: inherit; font-weight: 500;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input-icon-wrap .form-input { padding-left: 40px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.form-actions .btn { flex: 1; }

/* =========================================
   Auth
   ========================================= */
.auth-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0a0e1a, #1b1a38 60%, #2a1a35);
  display: grid; place-items: center;
  z-index: 4000; padding: 20px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s var(--ease);
}
.auth-logo {
  width: 56px; height: 56px;
  background: var(--gradient); color: #fff;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-size: 22px; margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
}
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* =========================================
   Admin Panel
   ========================================= */
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px; margin: 32px 0;
  box-shadow: var(--shadow-md);
}
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-title { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.admin-nav { display: flex; gap: 4px; background: var(--surface2); padding: 5px; border-radius: var(--radius-md); margin-bottom: 24px; overflow-x: auto; }
.admin-nav-item {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-weight: 600; font-size: 12px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.admin-nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.admin-nav-item.active { background: var(--gradient); color: #fff; box-shadow: var(--shadow-glow); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat {
  background: var(--surface2); padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.2s var(--ease);
}
.admin-stat:hover { transform: translateY(-2px); }
.admin-stat .icon { width: 40px; height: 40px; display: grid; place-items: center; font-size: 17px; margin-bottom: 12px; border-radius: var(--radius-sm); }
.admin-stat .value { font-size: 23px; font-weight: 700; margin-bottom: 4px; }
.admin-stat .label { color: var(--muted); font-size: 12px; font-weight: 600; }

/* Jadvallar */
.table-wrapper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.table-header { padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.table-title { font-size: 15px; font-weight: 700; }
.table-search { display: flex; gap: 8px; align-items: center; }
.table-search input { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); color: var(--text); font-family: inherit; font-size: 13px; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 14px 20px; background: var(--surface2); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* Status */
.status-badge { padding: 4px 12px; font-size: 11px; font-weight: 700; display: inline-block; border-radius: var(--radius-pill); }
.status-new { background: rgba(56, 189, 248, 0.15); color: var(--info); }
.status-processing { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.status-completed { background: rgba(52, 211, 153, 0.15); color: var(--secondary); }
.status-cancelled { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* =========================================
   Chat
   ========================================= */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  background: var(--gradient); color: #fff;
  border: none; border-radius: 50%;
  font-size: 22px; cursor: pointer;
  box-shadow: var(--shadow-glow);
  z-index: 1000;
  display: grid; place-items: center;
  transition: transform 0.2s var(--ease);
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab:active { transform: scale(0.96); }
.chat-widget {
  position: fixed; bottom: 96px; right: 24px;
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1001; display: none; flex-direction: column;
  overflow: hidden;
}
.chat-widget.active { display: flex; animation: scaleIn 0.2s var(--ease); }
.chat-header { background: var(--gradient); color: #fff; padding: 16px; display: flex; align-items: center; gap: 12px; }
.chat-header .avatar { width: 36px; height: 36px; background: rgba(255, 255, 255, 0.2); color: #fff; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 16px; }
.chat-header .info { flex: 1; }
.chat-header .name { font-weight: 700; font-size: 14px; }
.chat-header .status { font-size: 11px; font-weight: 500; opacity: 0.85; }
.chat-messages { height: 280px; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: var(--surface2); }
.chat-message { max-width: 80%; display: flex; flex-direction: column; gap: 4px; animation: fadeInUp 0.2s var(--ease); }
.chat-message.user { align-self: flex-end; }
.chat-message.admin { align-self: flex-start; }
.chat-message .bubble { padding: 10px 14px; font-size: 13px; line-height: 1.4; border-radius: var(--radius-md); }
.chat-message.user .bubble { background: var(--gradient); color: #fff; border-bottom-right-radius: var(--radius-sm); }
.chat-message.admin .bubble { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: var(--radius-sm); }
.chat-message .meta { font-size: 10px; color: var(--muted); font-weight: 600; }
.chat-input { padding: 12px; display: flex; gap: 8px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface2); color: var(--text); font-family: inherit; font-size: 13px; }
.chat-input input:focus { outline: none; border-color: var(--primary-light); }
.chat-input button { width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--gradient); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px; transition: transform 0.15s var(--ease); }
.chat-input button:hover { transform: scale(1.06); }

/* =========================================
   Footer
   ========================================= */
.footer { border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 64px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 500; }

/* =========================================
   Toast
   ========================================= */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; font-weight: 600; font-size: 13px;
  animation: slideInRight 0.25s var(--ease);
}
.toast.success { background: var(--surface); border-color: rgba(52, 211, 153, 0.4); }
.toast.success .toast-icon { color: var(--secondary); }
.toast.error { background: var(--surface); border-color: rgba(248, 113, 113, 0.4); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info, .toast.warning { background: var(--surface); border-color: rgba(56, 189, 248, 0.4); }
.toast.info .toast-icon { color: var(--info); }
.toast-icon { font-size: 18px; }

.sync-indicator {
  position: fixed; bottom: 24px; left: 24px;
  background: var(--surface); padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  z-index: 1000; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 8px var(--secondary); }

/* =========================================
   Splash Screen
   ========================================= */
.splash-screen {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10000; transition: opacity 0.5s ease;
}
.splash-screen.hidden { opacity: 0; pointer-events: none; }
.splash-logo {
  width: 80px; height: 80px;
  background: var(--gradient); color: #fff;
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  font-size: 36px; margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
  animation: pulse 2s infinite;
}
.splash-text {
  font-size: 26px; font-weight: 700; letter-spacing: 2px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 30px;
}
.splash-loader {
  width: 150px; height: 4px;
  background: var(--surface2); overflow: hidden;
  border-radius: var(--radius-pill);
}
.splash-loader::after {
  content: ''; display: block; width: 40%; height: 100%;
  background: var(--gradient);
  animation: slideRight 1.5s infinite ease-in-out;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.85; transform: scale(1.04); } }
@keyframes slideRight { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* =========================================
   Qo'shimcha funksiyalar
   ========================================= */

/* Solishtirish paneli */
.compare-bar {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 16px;
  z-index: 1400;
  max-width: calc(100vw - 40px);
  overflow-x: auto;
}
.compare-bar.active { display: flex; animation: slideInRight 0.2s var(--ease); }
.compare-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.compare-item button {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
}

/* Sharhlar */
.reviews-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.review-item {
  padding: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.review-stars {
  color: var(--warning);
  font-size: 14px;
}
.review-author {
  font-weight: 600;
  font-size: 13px;
}
.review-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.review-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* Reyting yulduzlari */
.star-rating {
  display: flex;
  gap: 4px;
  cursor: pointer;
}
.star-rating i {
  font-size: 24px;
  color: var(--muted);
  transition: color 0.2s;
}
.star-rating i.active,
.star-rating i:hover {
  color: var(--warning);
}

/* Buyurtma kuzatish */
.order-tracking {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  position: relative;
}
.order-tracking::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  z-index: 1;
}
.tracking-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  flex: 1;
}
.tracking-step .icon {
  width: 40px;
  height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--muted);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.tracking-step.active .icon {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.tracking-step .label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}
.tracking-step.active .label {
  color: var(--primary-light);
}

/* Referal statistika */
.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.referral-stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.referral-stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-light);
}
.referral-stat-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

/* Promo-kod */
.promo-input-wrap {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.promo-input-wrap input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
}
.promo-input-wrap button {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}

/* Statistika grafigi */
.chart-container {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}
.chart-container canvas {
  max-height: 300px;
}

/* =========================================
   Mobil ilova interfeysi
   ========================================= */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 1500;
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.2);
}
.mobile-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px; cursor: pointer; color: var(--muted);
  font-weight: 600; font-size: 10px;
  transition: color 0.2s; flex: 1; border: none;
  background: transparent; font-family: inherit; position: relative;
}
.mobile-nav-item i { font-size: 20px; }
.mobile-nav-item.active { color: var(--primary-light); }
.mobile-nav-item .badge {
  position: absolute; top: 4px; right: calc(50% - 20px);
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 5px;
  border-radius: var(--radius-pill); border: 2px solid var(--surface); min-width: 18px; text-align: center;
}

@media (max-width: 768px) {
  body { padding-bottom: 80px; }
  .mobile-nav { display: block; }

  .header { padding: 0; }
  .header-inner { height: 52px; padding: 0 12px; border-radius: 0; border-left: none; border-right: none; }
  .search-box { display: none; }
  .logo-text { font-size: 14px; }
  .logo-badge { display: none; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; font-size: 13px; }
  .header-balance { padding: 6px 8px; font-size: 10px; }
  .header-balance span { display: none; }
  .header-balance i { font-size: 14px; }
  .user-avatar { width: 36px; height: 36px; font-size: 13px; }

  .hero { padding: 28px 16px; margin: 12px 0; border-radius: var(--radius-md); }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 13px; }
  .hero-buttons { flex-direction: column; gap: 8px; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 16px; padding-top: 16px; }
  .hero-stat .value { font-size: 22px; }
  .hero-stat .label { font-size: 10px; }

  .section-header { margin-bottom: 16px; }
  .section-title { font-size: 20px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-card { border-radius: var(--radius-md); }
  .product-image { height: 130px; }
  .product-info { padding: 10px; }
  .product-name { font-size: 12px; }
  .product-desc { font-size: 10px; margin-bottom: 8px; }
  .product-price { font-size: 14px; }
  .product-actions { flex-direction: column; gap: 4px; }
  .product-actions .btn { padding: 6px 8px; font-size: 10px; }

  .user-profile { width: 100%; border-left: none; }

  .admin-panel { padding: 12px; margin: 16px 0; border-radius: var(--radius-md); }
  .admin-title { font-size: 17px; }
  .admin-nav { overflow-x: auto; padding: 4px; }
  .admin-nav-item { padding: 8px 12px; font-size: 10px; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .admin-stat { padding: 12px; }
  .admin-stat .value { font-size: 18px; }
  .admin-stat .label { font-size: 10px; }

  .chat-fab { bottom: 80px; right: 16px; width: 52px; height: 52px; font-size: 20px; }
  .chat-widget { bottom: 140px; right: 12px; left: 12px; width: auto; max-width: none; }

  .footer { padding: 24px 0 16px; margin-top: 32px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  .toast-container { top: 12px; right: 12px; left: 12px; }
  .toast { min-width: auto; width: 100%; }

  .sync-indicator { bottom: 80px; left: 12px; font-size: 10px; }

  .compare-bar {
    bottom: 90px;
    left: 12px;
    right: 12px;
    transform: none;
    padding: 10px;
  }
  .filters-bar .form-select { min-width: 140px; font-size: 11px; }
  .order-tracking { flex-direction: column; gap: 16px; }
  .order-tracking::before { display: none; }
  .tracking-step { flex-direction: row; gap: 12px; }
  .referral-stats-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr 1fr; }
  .product-actions { flex-direction: column; }
}
