:root {
  --bg: #05080a;
  --bg-2: #0b1013;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.06);
  --text: #f6f8fa;
  --text-muted: #9fb0b9;
  --gold: #f0c674;
  --gold-2: #d4a83a;
  --green: #2dd4a0;
  --green-2: #1b9976;
  --red: #ff6b6b;
  --orange: #ff9f43;
  --blue: #5dade2;
  --purple: #a569bd;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 24px;
  --radius-sm: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

/* ── Ambient background ── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(45, 212, 160, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(240, 198, 116, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(93, 173, 226, 0.06) 0%, transparent 45%),
    var(--bg);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.orb-1 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(45, 212, 160, 0.45), transparent 70%);
  top: -80px;
  left: -80px;
  animation-delay: 0s;
}

.orb-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(240, 198, 116, 0.40), transparent 70%);
  top: 30%;
  right: -120px;
  animation-delay: -6s;
}

.orb-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(93, 173, 226, 0.35), transparent 70%);
  bottom: -60px;
  left: 20%;
  animation-delay: -12s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── Glass utilities ── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}

.glass-3d {
  background: linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 32px 100px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(255,255,255,0.03);
  transform-style: preserve-3d;
}

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-glow {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px var(--green), 0 0 32px var(--green-2);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.logo-text {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, var(--text), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-chip {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip .name {
  color: var(--text);
  font-weight: 600;
}

.user-chip .logout {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.user-chip .logout:hover { color: var(--red); }

/* ── Main ── */
.main {
  padding: 92px 16px calc(96px + var(--safe-bottom));
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
}

.section {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ── Hero ── */
.hero-card {
  position: relative;
  padding: 32px 26px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(45, 212, 160, 0.12), rgba(240, 198, 116, 0.08)),
    var(--surface);
  border: 1px solid var(--glass-border);
}

.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/hero.jpg') center/cover;
  opacity: 0.22;
  mix-blend-mode: overlay;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(45, 212, 160, 0.15);
  border: 1px solid rgba(45, 212, 160, 0.25);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-title span {
  background: linear-gradient(90deg, var(--gold), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 460px;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 13px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 8px 24px rgba(45, 212, 160, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(45, 212, 160, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #151000;
  box-shadow: 0 8px 24px rgba(240, 198, 116, 0.22);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(240, 198, 116, 0.32);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--green), var(--gold), var(--blue), var(--green));
  background-size: 300% 300%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  animation: glowMove 4s ease infinite;
  transition: opacity 0.3s ease;
}

.btn-glow:hover::after { opacity: 0.6; }

@keyframes glowMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Catalog ── */
.section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 26px 0 14px;
}

.section-title:first-child { margin-top: 0; }

.category-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.product-card {
  position: relative;
  overflow: hidden;
}

.product-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.product-card:hover::after { left: 150%; }

.product-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.price-tag {
  font-weight: 800;
  font-size: 15px;
  color: var(--gold);
  white-space: nowrap;
}

.product-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 4px;
}

.qty-control button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-control button:hover { background: rgba(255,255,255,0.15); }

.qty-control span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* ── Cart / Order ── */
.order-summary {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

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

.order-item-name { flex: 1; font-size: 14px; }
.order-item-price { font-weight: 700; color: var(--gold); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.total-row .big {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-group input,
.input-group select,
.input-group textarea {
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 212, 160, 0.12);
}

/* ── Orders list ── */
.order-card {
  cursor: pointer;
}

.order-card:hover { transform: translateY(-3px); }

.badge {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-new { background: rgba(93, 173, 226, 0.18); color: var(--blue); }
.badge-confirmed { background: rgba(45, 212, 160, 0.18); color: var(--green); }
.badge-assembling { background: rgba(255, 159, 67, 0.18); color: var(--orange); }
.badge-ready { background: rgba(165, 105, 189, 0.18); color: var(--purple); }
.badge-delivered { background: rgba(45, 212, 160, 0.12); color: var(--green); }
.badge-cancelled { background: rgba(255, 107, 107, 0.18); color: var(--red); }

/* ── Partner ── */
.progress-wrap {
  background: rgba(0,0,0,0.25);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  box-shadow: 0 0 14px rgba(45, 212, 160, 0.4);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Support ── */
.support-messages {
  max-height: 44vh;
  overflow-y: auto;
  padding-right: 6px;
}

.support-messages::-webkit-scrollbar { width: 4px; }
.support-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.msg {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 10px;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.msg-user {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(240,198,116,0.18), rgba(240,198,116,0.08));
  border: 1px solid rgba(240,198,116,0.18);
  border-bottom-right-radius: 6px;
}

.msg-admin {
  background: var(--surface-hover);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 6px;
}

.msg-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Dock ── */
.dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 6px;
  padding: 8px;
  border-radius: 26px;
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}

.dock::-webkit-scrollbar { display: none; }

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  padding: 8px 6px;
  border: none;
  border-radius: 18px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dock-item:hover { color: var(--text); background: var(--surface-hover); }

.dock-item.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(45,212,160,0.25), rgba(240,198,116,0.15));
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.dock-icon { font-size: 20px; line-height: 1; }
.dock-label { font-size: 10px; font-weight: 600; }

/* ── Toast ── */
.toast {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 300;
  padding: 13px 22px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--red);
}

/* ── Loader ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 10, 0.65);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loader.show {
  opacity: 1;
  pointer-events: auto;
}

.loader-ring {
  position: relative;
  width: 56px;
  height: 56px;
}

.loader-ring div {
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader-ring div:nth-child(1) { animation-delay: -0.45s; border-top-color: var(--gold); }
.loader-ring div:nth-child(2) { animation-delay: -0.3s; border-top-color: var(--blue); }
.loader-ring div:nth-child(3) { animation-delay: -0.15s; border-top-color: var(--purple); }

@keyframes ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Auth modal ── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 10, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.auth-modal.show .auth-backdrop { opacity: 1; }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) rotateX(8deg);
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-modal.show .auth-card {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

.auth-shine {
  position: absolute;
  inset: -50%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
  transform: rotate(25deg);
  animation: shine 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(25deg); }
  20%, 100% { transform: translateX(100%) rotate(25deg); }
}

.auth-visual {
  position: relative;
  padding: 34px 28px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(45,212,160,0.12), rgba(240,198,116,0.08));
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-body {
  padding: 26px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* ── Empty / detail ── */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--text-muted);
}

.empty .emoji { font-size: 52px; margin-bottom: 14px; opacity: 0.7; }

.detail-block {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
}

.detail-row:last-child { border-bottom: none; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.back-btn:hover { background: var(--surface-hover); color: var(--text); }

/* ── Pager ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.pager button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.pager button:hover:not(:disabled) { background: var(--surface-hover); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Skeleton ── */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s infinite;
}

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

/* ── Hidden util ── */
.hidden { display: none !important; }

/* ── Desktop ── */
@media (min-width: 768px) {
  .main { padding-top: 100px; padding-bottom: 110px; }
  .dock { gap: 10px; padding: 10px 16px; }
  .dock-item { min-width: 72px; padding: 10px 12px; }
  .dock-label { font-size: 11px; }
}

@media (min-width: 1024px) {
  .main { max-width: 980px; }
  .category-row { grid-template-columns: repeat(3, 1fr); }
}
