:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --blue-glow: rgba(37, 99, 235, 0.35);
  --bg: #f0f2f8;
  --bg2: #e8ecf4;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(15, 23, 42, 0.08);
  --green: #16a34a;
  --green-bg: #dcfce7;
  --yellow: #ca8a04;
  --yellow-bg: #fef9c3;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --gray-bg: #f3f4f6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
  --shadow-btn: 0 6px 20px rgba(37, 99, 235, 0.35);
  --grad-main: linear-gradient(135deg, var(--blue), #3b82f6);
  --nav-h: 68px;
  --top-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --pad-x: 16px;
  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --tg-vw: 100%;
  --app-col: min(100%, 480px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: var(--tg-vw);
  max-width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  margin: 0 auto;
  padding: 0;
  direction: ltr;
}

/* Centered phone column on desktop Telegram */
.app-frame {
  position: relative;
  z-index: 1;
  width: var(--tg-vw);
  max-width: 100vw;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

input, textarea, select, button {
  font-family: var(--font);
}

.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }

/* Background */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(37, 99, 235, 0.14), transparent),
    radial-gradient(circle at 85% 90%, rgba(59, 130, 246, 0.08), transparent),
    linear-gradient(180deg, #f5f7fc 0%, #eef2f9 50%, #f0f2f8 100%);
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: rtl;
  background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 45%, #3b82f6 100%);
  color: #fff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  text-align: center;
  animation: float 2.5s ease-in-out infinite;
}

.splash-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
  margin-bottom: 12px;
}

.splash-logo h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}

.splash-logo p {
  margin: 8px 0 0;
  font-size: 0.88rem;
  opacity: 0.9;
}

.splash-loader {
  display: flex;
  gap: 6px;
  margin-top: 32px;
}

.splash-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: bounce 1.2s ease-in-out infinite;
}

.splash-loader span:nth-child(2) { animation-delay: 0.15s; }
.splash-loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* App shell */
.app {
  position: relative;
  z-index: 1;
  width: var(--app-col);
  max-width: 100%;
  flex: 0 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  direction: rtl;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  min-width: 0;
}

.app.is-navigating .main {
  pointer-events: none;
}

.topbar {
  position: relative;
  flex: 0 0 auto;
  z-index: 50;
  width: 100%;
  padding: 10px var(--pad-x) 8px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.page-title {
  grid-column: 2;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  margin: 0;
  min-width: 0;
}

.header-back {
  grid-column: 1;
  justify-self: center;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background: var(--grad-main);
  color: #fff;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.header-back:active { transform: scale(0.96); }
.header-back svg { width: 20px; height: 20px; }

.profile-btn {
  grid-column: 3;
  justify-self: center;
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.profile-btn:active { transform: scale(0.94); }

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--blue-glow);
  flex-shrink: 0;
}

.profile-avatar--photo {
  padding: 0;
  overflow: hidden;
  background: var(--blue-light);
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar--lg {
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
}

.profile-avatar svg { width: 22px; height: 22px; }
.profile-avatar--photo svg { display: none; }

.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

.main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: 16px var(--pad-x);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.main.fade-out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.main.fade-in {
  animation: slideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom nav — fixed, always visible */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: calc((var(--tg-vw) - var(--app-col)) / 2);
  width: var(--app-col);
  max-width: 100%;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  z-index: 60;
  direction: rtl;
}

.bottom-nav.hidden { display: none; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  transition: color 0.2s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--blue);
}

.bottom-nav .nav-item.hidden { display: none; }

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--blue);
  border-radius: 0 0 4px 4px;
}

.nav-item.active svg { transform: scale(1.08); }

/* Cards with stagger */
.hero,
.svc-card,
.list-card,
.testi-card,
.form-card,
.profile-card,
.ad-card,
.sample-card,
.empty,
.card-in {
  animation: cardIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.svc-card:nth-child(1), .list-card:nth-child(1), .testi-card:nth-child(1) { animation-delay: 0.03s; }
.svc-card:nth-child(2), .list-card:nth-child(2), .testi-card:nth-child(2) { animation-delay: 0.07s; }
.svc-card:nth-child(3), .list-card:nth-child(3), .testi-card:nth-child(3) { animation-delay: 0.11s; }
.svc-card:nth-child(4), .list-card:nth-child(4), .testi-card:nth-child(4) { animation-delay: 0.15s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  border-radius: 22px;
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 40px var(--blue-glow);
  margin-bottom: 20px;
}

.hero::before {
  content: "";
  position: absolute;
  left: -20px;
  bottom: -30px;
  width: 140px;
  height: 140px;
  opacity: 0.12;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cpath fill='white' d='M120 0C53.7 0 0 53.7 0 120s53.7 120 120 120 120-53.7 120-120S186.3 0 120 0zm52.3 82.3l-22 96.5c-1.6 7-5.7 8.7-11.6 5.4l-32-23.6-15.4 14.8c-1.7 1.7-3.1 3.1-6.4 3.1l2.3-32.5 59.6-53.8c2.6-2.3-.6-3.6-4-1.3l-73.7 46.4-31.8-9.9c-6.9-2.2-7-6.9 1.5-10.2l124.5-48c5.7-2.1 10.7 1.4 8.9 9.1z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.hero h2 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.6;
  position: relative;
}

.hero p {
  font-size: 0.82rem;
  opacity: 0.92;
  margin-top: 8px;
  position: relative;
}

.hero .btn-start {
  margin-top: 16px;
  background: #fff;
  color: var(--blue);
  border: none;
  border-radius: 14px;
  padding: 11px 22px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero .btn-start:active { transform: scale(0.96); }

/* Service grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.svc-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 1px solid rgba(37, 99, 235, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.svc-card:active {
  transform: scale(0.96);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
}

.svc-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: transform 0.2s ease;
}

.svc-card:active .svc-icon { transform: scale(1.05); }

.svc-icon.blue { background: #dbeafe; }
.svc-icon.yellow { background: #fef3c7; }
.svc-icon.purple { background: #ede9fe; }
.svc-icon.green { background: #d1fae5; }

.svc-card span {
  font-size: 0.82rem;
  font-weight: 700;
  display: block;
}

.sec-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
}

/* Testimonials */
.testi-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 8px;
}

.testi-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
}

.testi-scroll::-webkit-scrollbar { display: none; }

.testi-card {
  flex: 0 0 85%;
  max-width: 320px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform 0.18s ease;
}

.testi-card:active { transform: scale(0.98); }

.testi-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.testi-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.testi-name { font-weight: 800; font-size: 0.88rem; }

.testi-user {
  font-size: 0.75rem;
  color: var(--blue);
  cursor: pointer;
  transition: opacity 0.15s;
}

.testi-user:active { opacity: 0.7; }

.testi-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.75;
}

/* List cards */
.list-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.list-card:active {
  transform: scale(0.985);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.list-card .svc-icon {
  margin: 0;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

.list-card-body { flex: 1; min-width: 0; }
.list-card-body h3 { font-size: 0.92rem; font-weight: 800; }
.list-card-body p { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.list-card .chev { color: #d1d5db; font-size: 1.2rem; }

/* Empty */
.empty {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-bg);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #9ca3af;
  animation: float 3s ease-in-out infinite;
}

.empty h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.empty p { font-size: 0.82rem; color: var(--muted); line-height: 1.75; max-width: 280px; margin: 0 auto 20px; }

/* Forms */
.form-card,
.profile-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  touch-action: manipulation;
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }

.field-reveal {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition:
    max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    margin-top 0.3s ease;
  pointer-events: none;
  will-change: max-height, opacity;
}

.field-reveal--open {
  max-height: 520px;
  opacity: 1;
  margin-top: 10px;
  pointer-events: auto;
}

.field-reveal__inner {
  overflow: hidden;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field textarea { min-height: 90px; resize: vertical; }
.field-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.check-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.check-row--nowrap { flex-wrap: nowrap; }
.check-row label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; }
.check-row--nowrap label { white-space: nowrap; }

.seg-control {
  display: grid;
  grid-template-columns: repeat(var(--seg-cols, 2), minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  background: #eef2f8;
  border-radius: 14px;
  margin-top: 6px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.seg-control input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.seg-control label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 8px;
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    color 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.seg-control input:checked + label {
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  box-shadow: 0 4px 14px var(--blue-glow);
}

.seg-control input:focus-visible + label {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.price-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 14px 0 0;
  border: 1px solid #bfdbfe;
  transition: opacity 0.15s ease;
}

.price-box.is-loading { opacity: 0.65; }

.price-box .amount { font-size: 1.2rem; font-weight: 800; color: var(--blue-dark); }
.price-box .sub { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  box-shadow: 0 6px 22px var(--blue-glow);
}

.btn-soft {
  background: var(--blue-light);
  color: var(--blue);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.discount-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 16px 0 0;
}

.discount-row .discount-code {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  background: #fafbfc;
  color: var(--text);
  direction: rtl;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.discount-row .discount-code:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.discount-row .apply-discount {
  width: auto;
  flex-shrink: 0;
  padding: 12px 18px;
  white-space: nowrap;
}

.form-card > .btn,
.form-card > .btn-primary,
.profile-card > .btn {
  margin-top: 20px;
}

.form-card .btn-pay {
  margin-top: 20px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge.green { background: var(--green-bg); color: var(--green); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: var(--gray-bg); color: #6b7280; }
.badge.blue { background: var(--blue-light); color: var(--blue); }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 14px; }

.stars-input {
  display: flex;
  gap: 6px;
  margin: 10px 0;
  direction: ltr;
  justify-content: flex-end;
}

.stars-input button {
  border: none;
  background: none;
  font-size: 1.45rem;
  cursor: pointer;
  color: #d1d5db;
  transition: transform 0.15s, color 0.15s;
}

.stars-input button.on { color: #fbbf24; }
.stars-input button:active { transform: scale(1.15); }

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.order-item:last-child { border-bottom: none; }

.ad-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border-right: 4px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.15s ease;
}

.ad-card:active { transform: scale(0.985); }
.ad-card.active { border-right-color: var(--green); }
.ad-card.stopped { border-right-color: var(--red); }
.ad-card.finished { border-right-color: #9ca3af; }
.ad-card.reviewing { border-right-color: var(--yellow); }

/* Chart */
.chart-tabs { display: flex; gap: 8px; margin: 12px 0; }

.chart-tabs button {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-tabs button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.chart-area {
  height: 160px;
  background: var(--card);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  box-shadow: var(--shadow);
}

.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--blue), #93c5fd);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.stat-box {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-box .val { font-size: 1.1rem; font-weight: 800; color: var(--blue); }
.stat-box .lbl { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

/* Samples */
.samples-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.sample-card {
  flex: 0 0 200px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sample-card .thumb {
  height: 120px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.sample-card .body { padding: 12px; }
.sample-card .body h4 { font-size: 0.85rem; margin-bottom: 8px; }

/* Info */
.info-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  line-height: 1.8;
  color: #0c4a6e;
}

.preview-img {
  width: 100%;
  border-radius: 14px;
  margin: 12px 0;
  cursor: pointer;
  background: #e5e7eb;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.15s;
}

.preview-img:active { transform: scale(0.98); }

/* Payment */
.pay-tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.pay-tabs button {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pay-tabs button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eff6ff;
}

.card-info {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-info .num {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  direction: ltr;
  margin: 10px 0;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone.is-uploading {
  border-color: var(--blue);
  color: var(--blue);
  background: #f8fbff;
  pointer-events: none;
}

.upload-zone-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.upload-zone.has-file {
  border-color: var(--blue);
  color: var(--blue);
  background: #eff6ff;
}

.upload-zone.has-preview {
  padding: 10px;
}

.upload-preview-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: #fff;
}

/* Help */
.help-block { margin-bottom: 18px; }
.help-block strong { display: block; margin-bottom: 6px; font-size: 0.9rem; }
.help-block p { font-size: 0.84rem; color: var(--muted); line-height: 1.8; }
.help-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.kw-tag {
  background: var(--blue-light);
  color: var(--blue);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.loading-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  animation: bounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Toast & loader */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 150;
  max-width: 90%;
  font-size: 0.85rem;
  font-weight: 600;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.loader {
  position: fixed;
  inset: 0;
  background: rgba(240, 242, 248, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 140;
}

.loader-ring {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; }

.lightbox-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

.tg-blocked {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  direction: rtl;
  background: var(--bg);
  padding: 24px;
  text-align: center;
}

.tg-blocked a {
  margin-top: 16px;
  background: var(--blue);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 800;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 360px) {
  .nav-item { font-size: 0.58rem; }
  .nav-item svg { width: 20px; height: 20px; }
}

/* Desktop polish */
@media (min-width: 481px) {
  .app {
    box-shadow: var(--shadow);
  }
}

/* ── Admin panel (ShivaSell-style, blue theme) ── */
.admin-page .admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-page .admin-header h2 { margin: 0; font-size: 1.15rem; }

.admin-badge {
  font-size: 0.68rem;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  border-radius: 99px;
  font-weight: 600;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.admin-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-stat.wide { grid-column: 1 / -1; }

.admin-stat span {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--blue);
}

.admin-stat small { color: var(--muted); font-size: 0.68rem; }

.admin-toolbar { margin-bottom: 14px; }

.admin-order-list { display: flex; flex-direction: column; gap: 10px; }

.admin-order-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
}

.admin-order-row.clickable { cursor: pointer; transition: transform 0.15s; }
.admin-order-row.clickable:active { transform: scale(0.98); }

.admin-order-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-order-row-top code { font-size: 0.72rem; color: var(--blue); }

.admin-order-row-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.admin-order-row-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.order-status {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--gray-bg);
}

.order-status.delivered,
.order-status.approved {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.2);
}

.order-status.rejected {
  background: var(--red-bg);
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.2);
}

.admin-customer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-subtitle { margin: 0 0 12px; font-size: 0.9rem; }

.admin-items { display: flex; flex-direction: column; gap: 10px; }

.admin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.admin-item div { flex: 1; min-width: 0; }
.admin-item strong { display: block; font-size: 0.82rem; }
.admin-item small { color: var(--muted); }

.admin-stage-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-stage-btn {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  text-align: right;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}

.admin-stage-btn.done { border-color: rgba(37, 99, 235, 0.35); }

.admin-stage-btn.active {
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tabs--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}

.admin-tab {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

.admin-tabs--grid .admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  min-width: 0;
  font-size: 0.72rem;
}

.admin-tab.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.25);
}

.admin-user-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.admin-user-main strong { font-size: 0.88rem; display: block; }

.admin-user-id {
  font-size: 0.72rem;
  color: var(--blue);
  display: block;
  margin: 2px 0;
}

.admin-user-main small { color: var(--muted); font-size: 0.75rem; }

.admin-broadcast-card { margin-top: 8px; }

.admin-danger-card {
  border-color: rgba(220, 38, 38, 0.25);
  background: var(--red-bg);
}

.admin-reset-btn { margin-top: 10px; }

.admin-reset-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

.empty-state {
  text-align: center;
  padding: 32px 20px;
}

.empty-state.compact { padding: 20px 12px; }

.empty-state .icon { font-size: 2rem; margin-bottom: 8px; }

.empty-state h4 { margin: 0 0 8px; }

.empty-state p { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.search-bar svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.88rem;
  outline: none;
}

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
}

.filter-chip.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.25);
}

.glass-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.payment-settings-grid,
.discount-admin-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field span { font-size: 0.78rem; font-weight: 700; color: var(--muted); }

.form-field input,
.form-field textarea {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  background: #fafbfc;
}

.payment-settings-note { margin-bottom: 12px; }

.payment-admin-list,
.review-admin-list,
.discount-admin-list,
.request-admin-list,
.ad-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-admin-card,
.review-admin-card,
.request-admin-card,
.ad-admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.payment-admin-head,
.review-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.payment-admin-user {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.tracking-code-sm { font-size: 0.72rem; color: var(--blue); }

.payment-status-badge {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.payment-status-badge.pending {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.payment-admin-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.payment-admin-items {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.payment-receipt-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.payment-receipt-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.payment-admin-date {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.payment-admin-actions {
  display: flex;
  gap: 8px;
}

.payment-admin-actions .btn { flex: 1; }

.review-admin-text {
  font-size: 0.85rem;
  line-height: 1.65;
  margin: 8px 0;
}

.stars--lg { font-size: 1.1rem; color: #fbbf24; letter-spacing: 2px; }

.discount-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.discount-admin-row strong { display: block; font-size: 0.9rem; }

.discount-admin-row small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.ad-admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.ad-admin-stat {
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.ad-admin-stat strong { display: block; color: var(--blue); margin-top: 2px; }

.ad-admin-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.ad-admin-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.ad-admin-form input,
.ad-admin-form select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
}

.btn-sm { padding: 8px 12px; font-size: 0.78rem; }

.btn-block { width: 100%; }

.checkout-rows { display: flex; flex-direction: column; gap: 8px; }

.checkout-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.checkout-row.highlight strong { color: var(--blue); }

.profile-admin-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition: transform 0.15s;
}

.profile-admin-link:active { transform: scale(0.98); }
