/* =========================================================
   Milliy Pin — global stillar va komponentlar
   Barcha ranglar, radius, oraliq va soyalar tokens.css dan olinadi.
   ========================================================= */

/* ---------- Asos ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 500 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.5; }
input { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }

.i {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.i-sm { width: 18px; height: 18px; }
.i-xs { width: 14px; height: 14px; stroke-width: 2.5; }

.view {
  min-height: 100vh;
  padding: 12px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 36px);
}
.view.no-tabbar { padding-bottom: calc(var(--safe-bottom) + 32px); }
.page { animation: page-in 0.25s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

.hint { color: var(--hint); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pressable { transition: transform 0.12s ease, opacity 0.12s ease; }
.pressable:active { transform: scale(0.97); opacity: 0.9; }

/* Naqshli fon: ::before girih bilan, bolalar ustida */
.ornament { position: relative; overflow: hidden; isolation: isolate; }
.ornament::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--orn-color, #fff); opacity: var(--orn-opacity, 0.13);
  -webkit-mask: var(--girih) 0 0 / 56px 56px repeat;
  mask: var(--girih) 0 0 / 56px 56px repeat;
}
.ikat-band {
  height: 8px; margin: 0 -1px;
  background: var(--gold); opacity: 0.55;
  -webkit-mask: var(--ikat) 0 0 / 16px 8px repeat-x;
  mask: var(--ikat) 0 0 / 16px 8px repeat-x;
}

.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 28px 4px 12px;
  font-size: 20px; font-weight: 800; letter-spacing: -0.4px;
}
.title-mark { color: var(--gold); display: inline-flex; }
.title-mark .i { width: 20px; height: 20px; }
.group-title {
  margin: 24px 16px 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--hint);
}

.card {
  background: var(--grad-card), var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  color: var(--chip, var(--accent));
  background: color-mix(in srgb, var(--chip, var(--accent)) 14%, transparent);
}
.chip.solid { color: #fff; background: var(--chip, var(--accent)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--radius-sm);
  background: var(--grad-brand); color: var(--accent-text);
  font-size: 16px; font-weight: 700;
}
.btn.block { width: 100%; }
.btn.soft { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.white { background: #fff; color: #161a23; }
.btn.success { background: var(--green); color: #fff; }
.btn.danger-soft { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }

/* ---------- Tab bar (suzuvchi) ---------- */
.tabbar {
  position: fixed; z-index: 20;
  left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 10px 30px rgba(20, 20, 40, 0.14), 0 0 0 0.5px var(--sep);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 0; min-height: 52px; padding: 6px 0 5px; border-radius: 18px; color: var(--hint);
  font-size: 10.5px; font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}
.tab .i { width: 24px; height: 24px; transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1); }
.tab[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.tab[aria-current="page"] .i { transform: translateY(-1px) scale(1.08); }

/* ---------- Brend ---------- */
.brand-bar { display: flex; align-items: center; gap: 10px; padding: 2px 0 14px; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; color: #fff;
  background: var(--grad-brand); box-shadow: var(--shadow-lg);
}
.brand-mark .i { width: 24px; height: 24px; }
.brand-mark.sm { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; }
.brand-mark.sm .i { width: 20px; height: 20px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.1; }
.brand-name span { color: var(--gold); }
.brand-tag { font-size: 12px; color: var(--hint); font-weight: 600; }

.avatar {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 46px; height: 46px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, hsl(var(--hue) 70% 58%), hsl(calc(var(--hue) + 40) 65% 46%));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xl { width: 76px; height: 76px; font-size: 30px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--tap); padding: 0 14px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 800;
}
.pill .i { color: var(--accent); }

/* ---------- Bosh sahifa ---------- */
.hero {
  padding: 20px 16px 16px; border-radius: var(--radius); color: #fff;
  background: var(--grad-brand); box-shadow: var(--shadow-lg);
}
.hero .avatar { border: 2.5px solid rgba(255, 255, 255, 0.5); }
.hero h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.hero p { font-size: 14px; opacity: 0.88; }
.search-fake {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 48px; margin-top: 16px; padding: 0 14px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96); color: #7d8291; text-align: left; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.search-fake .i { color: #1b5fc1; }
:root[data-theme="dark"] .search-fake { background: rgba(11, 17, 32, 0.55); color: rgba(255, 255, 255, 0.75); }
:root[data-theme="dark"] .search-fake .i { color: #fff; }

.promo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  margin-top: 14px; padding: 18px 16px; border-radius: var(--radius);
  color: #fff; background: var(--grad-gold);
}
.promo .row { width: 100%; }
.promo .bubble {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, 0.22);
}
.promo h3 { font-size: 17px; font-weight: 800; }
.promo p { font-size: 13px; opacity: 0.92; margin-top: 2px; }
.promo .btn { margin-left: 62px; color: #a8323a; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; }
.trust-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--hint); line-height: 1.3;
}
.trust-item .i { color: var(--accent-2); }

/* ---------- Mahsulot sahifasi ---------- */
.product-hero {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: -12px -16px 0; padding: 28px 24px 8px; text-align: center;
  --orn-color: var(--accent); --orn-opacity: 0.06;
}
.product-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin-top: 6px; }
.product-hero p { color: var(--hint); max-width: 320px; font-weight: 500; }

.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.package {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px; min-height: 96px; text-align: left;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.package .qty { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.package .price { font-size: 14px; color: var(--hint); font-weight: 600; }
.package .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
.package .tick {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--sep); color: transparent;
  transition: all 0.15s ease;
}
.package[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.package[aria-checked="true"] .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.package[aria-checked="true"] .price { color: var(--text); }

.field { padding: 14px 16px; }
.field + .field { border-top: 1px solid var(--sep); }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--hint); margin-bottom: 8px; }
.input-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 14px; border-radius: var(--radius-sm);
  background: var(--field); color: var(--hint);
  border: 1.5px solid transparent; transition: border-color 0.15s ease;
}
.input-wrap.sm { height: 40px; width: 130px; padding: 0 10px; border-radius: 10px; }
.input-wrap:focus-within { border-color: var(--accent); }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 600; color: var(--text); }
.input-wrap.sm input { font-size: 15px; text-align: right; }
.input-wrap .prefix { color: var(--hint); font-size: 16px; }
.field.invalid .input-wrap { border-color: var(--red); }
.field .field-hint { margin-top: 6px; font-size: 12px; color: var(--hint); }
.field.invalid .field-hint { color: var(--red); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; text-align: left; }
.toggle-row .title { font-weight: 700; }
.switch {
  position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px;
  background: var(--sep); transition: background 0.2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease;
}
[aria-checked="true"] > .switch { background: var(--green); }
[aria-checked="true"] > .switch::after { transform: translateX(20px); }

.note { display: flex; gap: 10px; margin-top: 16px; padding: 0 4px; font-size: 13px; color: var(--hint); }
.note .i { color: var(--gold); }

/* ---------- Ro'yxatlar ---------- */
.list { overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 16px; text-align: left; position: relative;
}
.list-row + .list-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 74px;
  border-top: 1px solid var(--sep);
}
.list-row.plain + .list-row.plain::before { left: 16px; }
.list-row .title { font-weight: 700; }
.list-row .sub { font-size: 13px; color: var(--hint); margin-top: 1px; }
.list-row .end, .order-card .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.list-row .chev { color: var(--hint); opacity: 0.6; }
button.list-row:active { background: var(--card-2); }

.seg {
  display: inline-grid; grid-auto-flow: column; gap: 2px;
  padding: 3px; border-radius: 11px; background: var(--field);
}
.seg button { min-height: 38px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--hint); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

/* ---------- Qidiruv ---------- */
.search-bar {
  position: sticky; top: 0; z-index: 5;
  margin: -12px -16px 0; padding: 12px 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.search-bar .input-wrap { background: var(--card); box-shadow: var(--shadow); }

/* ---------- Bo'sh holat ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 24px; text-align: center; }
.empty .bubble {
  display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 8px;
  border-radius: 28px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  transform: rotate(45deg);
}
.empty .bubble .i { width: 38px; height: 38px; transform: rotate(-45deg); }
.empty h2 { font-size: 20px; font-weight: 800; }
.empty p { color: var(--hint); max-width: 280px; margin-bottom: 12px; }
.empty .btn + .btn { margin-top: 0; }

.success .bubble { color: #fff; background: var(--green); animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { from { transform: rotate(45deg) scale(0.4); opacity: 0; } }

/* ---------- Profil ---------- */
.profile-card {
  padding: 20px 16px 18px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, var(--r1), var(--r2));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--r2) 35%, transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.profile-card .avatar { border: 3px solid rgba(255, 255, 255, 0.4); }
.profile-card h2 { font-size: 20px; font-weight: 800; }
.profile-card .meta { font-size: 14px; opacity: 0.88; font-weight: 600; }
.profile-card .id-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 13px; opacity: 0.85; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.stat { padding: 14px; }
.stat .label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--hint); font-weight: 600; }
.stat .value { margin-top: 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.stat .btn { margin-top: 10px; width: 100%; }

.ref-link {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm); background: var(--field);
  font-size: 13px; font-weight: 600; text-align: left; width: 100%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, transparent);
}
.ref-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ref-head { display: flex; gap: 12px; }
.ref-head h3 { font-size: 17px; font-weight: 800; }

/* ---------- Admin panel ---------- */
.admin-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 14px; }
.admin-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.admin-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding: 4px; margin-bottom: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
}
.admin-tabs button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: 12px; font-size: 10.5px; font-weight: 700; color: var(--hint);
  min-width: 0;
}
.admin-tabs span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-tabs button[aria-selected="true"] { background: var(--grad-brand); color: #fff; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { padding: 16px; }
.kpi.wide { grid-column: 1 / -1; }
.kpi-label { font-size: 13px; color: var(--hint); font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; margin-top: 2px; }
.kpi-sub { font-size: 12px; color: var(--hint); font-weight: 600; margin-top: 2px; }

.filter-row { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter {
  flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 700; color: var(--hint);
}
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.order-card { padding: 14px; margin-bottom: 10px; }
.order-card .title { font-weight: 800; }
.kv { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--field); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.kv dt { color: var(--hint); font-weight: 600; }
.kv dd button { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); text-align: right; }
.order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.admin-product { margin-bottom: 12px; overflow: hidden; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-weight: 700; border-top: 1px solid var(--sep); }
.price-save { padding: 10px 16px 14px; }

/* ---------- Fon: aurora + naqsh ---------- */
body::before, body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body::before {
  background:
    radial-gradient(110% 55% at 100% -5%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 62%),
    radial-gradient(90% 50% at -10% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(90% 45% at 50% 105%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%);
}
body::after {
  background: var(--accent-2); opacity: var(--pattern-opacity);
  -webkit-mask: var(--pattern-islimi) 0 0 / 64px 64px, linear-gradient(#000 0%, transparent 70%);
  -webkit-mask-composite: source-in;
  mask: var(--pattern-islimi) 0 0 / 64px 64px, linear-gradient(#000 0%, transparent 70%);
  mask-composite: intersect;
}

.page-title { margin: 8px 4px 16px; font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }

/* ---------- Ilova uslubidagi mahsulotlar ---------- */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
.app-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.app-img {
  position: relative; display: block; width: 100%; aspect-ratio: 1;
  border-radius: 26%; overflow: hidden; background: var(--card);
  box-shadow: 0 8px 20px rgba(30, 30, 60, 0.12), 0 0 0 0.5px var(--sep);
}
.p-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.p-img.thumb { flex: none; width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 0 0 0.5px var(--sep); }
.app-badge {
  position: absolute; left: 6px; bottom: 6px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(10, 14, 28, 0.62); color: #fff; font-size: 10px; font-weight: 800;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.app-name {
  width: 100%; font-size: 13.5px; font-weight: 800; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-price { margin-top: -3px; font-size: 11.5px; font-weight: 700; color: var(--hint); }

.hero-img {
  display: block; width: 120px; height: 120px; border-radius: 32px; overflow: hidden; flex: none;
  box-shadow: 0 18px 36px rgba(20, 30, 70, 0.25), 0 0 0 0.5px var(--sep);
}
.hero-img.sm { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 8px 20px rgba(20, 30, 70, 0.18); }

.mini-icon {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 11px;
  color: var(--k); background: color-mix(in srgb, var(--k) 15%, transparent);
}
.mini-icon.lg { width: 46px; height: 46px; border-radius: 14px; }
.kpi .mini-icon { margin-bottom: 10px; }

/* ---------- Darajalar ---------- */
.emblem { flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22)); }
.emblem.locked { filter: grayscale(1); opacity: 0.45; }

.bar { display: block; height: 6px; margin: 7px 0 5px; border-radius: 999px; background: var(--field); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--r1), var(--r2)); transition: width 0.6s ease; }
.bar.light { background: rgba(255, 255, 255, 0.28); }
.bar.light > span { background: #fff; }

.rank-strip { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; text-align: left; }
.rank-strip b { font-size: 15px; font-weight: 800; }
.rank-strip .chev { color: var(--hint); }

.rank-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 16px; padding: 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.16); color: #fff; text-align: left;
}
.rank-title { display: block; font-size: 14px; font-weight: 800; }
.rank-row .small { display: block; opacity: 0.92; }

.rank-hero {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 24px 20px 20px; border-radius: var(--radius); color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--r1), var(--r2));
  box-shadow: 0 14px 32px color-mix(in srgb, var(--r2) 35%, transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.rank-hero h1 { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.rank-hero .bar { width: 100%; max-width: 280px; }

.how-xp { display: flex; gap: 12px; margin-top: 12px; }
.how-xp h3 { font-size: 15px; font-weight: 800; }

.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ladder-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid transparent; }
.ladder-item.current { border-color: var(--r2); box-shadow: 0 8px 24px color-mix(in srgb, var(--r2) 25%, transparent); }
.ladder-item.locked { opacity: 0.8; }
.ladder-item b { font-size: 16px; font-weight: 800; }
.perk { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--green); }
.ladder-item.locked .perk { color: var(--hint); }
.state { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--field); color: var(--hint); }
.state.ok { background: var(--green); color: #fff; }

/* ---------- Admin: formalar ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 4px 10px; }
.section-head h3 { font-size: 17px; font-weight: 800; }
.filter.off { opacity: 0.5; }
.filter .i { vertical-align: -2px; }
.gold-kpi { background: var(--grad-gold); color: #fff; }
.gold-kpi .kpi-label, .gold-kpi .kpi-sub { color: rgba(255, 255, 255, 0.88); }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }

.form { display: grid; gap: 12px; }
.card + .card.form, .card.form + .card { margin-top: 12px; }
.form-label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--hint); }
.form input:not([type="color"]), .form select, .form textarea, .package-row input, .package-row select, .grid-3 input:not([type="color"]) {
  width: 100%; min-width: 0; height: 46px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid transparent; outline: 0; background: var(--field); color: var(--text);
  font: 600 15px var(--font);
}
.form textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .package-row input:focus, .grid-3 input:focus { border-color: var(--accent); }
input[readonly] { opacity: 0.6; }
input[type="color"] { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; }

.i18n-input { display: flex; align-items: center; gap: 8px; }
.lang-tag {
  flex: none; padding: 4px 6px; border-radius: 6px; font-size: 11px; font-weight: 800;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.lang-seg { justify-self: start; }
.lang-pane { display: grid; gap: 12px; }
.chip-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { padding: 8px 12px; border-radius: 999px; background: var(--field); color: var(--hint); font-size: 13px; font-weight: 700; }
.chip-toggle[aria-pressed="true"] { background: var(--accent); color: #fff; }
.toggle-row.flush { padding: 4px 0; }

.image-editor { display: flex; align-items: center; gap: 14px; }
label.btn { cursor: pointer; }

.package-row {
  display: grid; grid-template-columns: 0.9fr 1.2fr 1.3fr auto; gap: 8px; align-items: end;
  padding: 12px 14px;
}
.package-row + .package-row { border-top: 1px solid var(--sep); }
.package-row label span { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--hint); }
.package-row input, .package-row select { height: 42px; padding: 0 10px; font-size: 14px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 42px; border-radius: 12px; background: var(--field); color: var(--hint); }

.editor-actions {
  position: sticky; bottom: calc(12px + var(--safe-bottom)); z-index: 5;
  display: flex; gap: 10px; margin-top: 20px;
}
.editor-actions .btn { box-shadow: var(--shadow-lg); }
.btn.grow { flex: 1; }

.rank-editor { margin-bottom: 10px; }
.rank-editor .form { margin-top: 12px; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 12px; }

/* ---------- Sheet va toast ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 25, 0.45); animation: fade-in 0.2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  padding: 8px 16px calc(16px + var(--safe-bottom));
  border-radius: 24px 24px 0 0; background: var(--bg);
  animation: sheet-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet .grabber { width: 36px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--sep); }
.sheet h3 { margin: 0 4px 12px; font-size: 17px; font-weight: 800; text-align: center; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px); z-index: 50;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 14px;
  background: rgba(16, 22, 38, 0.94); color: #fff; font-size: 14px; font-weight: 600;
  animation: fade-in 0.2s ease;
}

/* ---------- Skeleton ---------- */
.skeleton-screen { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.sk { border-radius: 14px; background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.sk-line { height: 18px; }
.w60 { width: 60%; } .w40 { width: 40%; }
.sk-block { height: 96px; border-radius: var(--radius); }
.sk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sk-tile { height: 120px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Umumiy komponentlar (ui.js) ---------- */
/* Kichik tugmalarning bosish maydonini 44px gacha kengaytirish */
.hit { position: relative; }
.hit::after { content: ""; position: absolute; inset: -8px; }

/* Naqshli ajratgich */
.divider { display: flex; align-items: center; gap: 10px; margin: 26px 12px 6px; color: var(--gold); }
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--c-gold) 45%, transparent), transparent);
}
.divider .i { width: 14px; height: 14px; }

/* Statistika kartalari (3 ta, gorizontal) */
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stat-card { padding: 12px 10px; min-width: 0; }
.stat-card .mini-icon { width: 30px; height: 30px; border-radius: 9px; margin-bottom: 8px; }
.stat-card .label { font-size: 11.5px; font-weight: 700; color: var(--hint); }
.stat-card .value { margin-top: 2px; font-size: 15px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.25; overflow-wrap: anywhere; }

/* Menyu qatori */
.menu-item { min-height: 64px; }
.menu-desc { display: block; font-size: 12.5px; font-weight: 600; color: var(--hint); margin-top: 1px; }
.list-row .mini-icon + .grow { min-width: 0; }

/* Progress bar */
.progress-bar { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--field); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--grad-brand); transition: width 0.6s ease; }

/* Foydalanuvchi kartasi */
.user-card { display: flex; align-items: center; gap: 14px; padding: 18px 16px; }
.user-card h2 { font-size: 19px; font-weight: 800; }
.user-card .meta { font-size: 14px; font-weight: 600; color: var(--hint); }
.user-card .id-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 13px; font-weight: 700; color: var(--accent); }
.user-card .version { font-size: 11px; font-weight: 600; color: var(--hint); opacity: 0.8; }
.avatar-frame {
  flex: none; padding: 3px; border-radius: 50%;
  background: repeating-conic-gradient(var(--c-gold) 0 12deg, var(--c-teal) 12deg 24deg, var(--c-blue) 24deg 36deg);
}
.avatar-frame .avatar { display: grid; border: 3px solid var(--card); }

/* Sozlamalar */
.setting-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; width: 100%; text-align: left; position: relative; }
.setting-row + .setting-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--sep); }
.setting-row .title { font-weight: 700; }
.seg.lg button { min-height: 40px; }

/* Suzuvchi yordam tugmasi */
.fab {
  position: fixed; z-index: 19; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  color: #fff; background: var(--grad-brand); box-shadow: var(--shadow-lg);
}
.fab .i { width: 26px; height: 26px; }
.view.has-fab { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 96px); }

/* Sevimli tugmasi */
.fav-btn {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%;
  background: var(--card); border: 1px solid var(--card-border); color: var(--hint); box-shadow: var(--shadow);
}
.fav-btn[aria-pressed="true"] { color: var(--red); }
.fav-btn[aria-pressed="true"] .i { fill: currentColor; }
.product-hero { position: relative; }

/* Kategoriya filtrlari */
.cat-row { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 4px; padding: 2px 16px 6px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-row button {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill);
  background: var(--card); border: 1px solid var(--card-border); font-size: 14px; font-weight: 700; color: var(--hint);
}
.cat-row button[aria-pressed="true"] { background: var(--grad-brand); border-color: transparent; color: #fff; }
.products-grid { margin-top: 12px; }

/* To'lov */
.balance-card { padding: 20px 18px; border-radius: var(--radius); color: #fff; background: var(--grad-brand); box-shadow: var(--shadow-lg); }
.balance-card .label { font-size: 14px; font-weight: 600; opacity: 0.9; }
.balance-card .value { margin-top: 4px; font-size: 32px; font-weight: 800; letter-spacing: -0.8px; }
.balance-card .hint-line { margin-top: 6px; font-size: 13px; opacity: 0.88; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.preset-row button { min-height: var(--tap); border-radius: 12px; background: var(--field); font-weight: 800; font-size: 14px; }
.preset-row button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.step-num {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent-2) 15%, transparent); color: var(--accent-2); font-weight: 800;
}

/* Top xaridorlar */
.top-row.me { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.place {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--field); font-weight: 800; color: var(--hint);
}
.place.p1 { background: linear-gradient(135deg, #f5d36b, #c9971f); color: #fff; }
.place.p2 { background: linear-gradient(135deg, #d6dde8, #8d99ad); color: #fff; }
.place.p3 { background: linear-gradient(135deg, #e3a06b, #a4602e); color: #fff; }

.loyalty-next { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--hint); }

/* Animatsiyalarni kamaytirish (profil sozlamasi) */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation: none !important; transition: none !important;
}
:root[data-motion="reduce"] .tabbar, :root[data-motion="reduce"] .app-badge { -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-motion="reduce"] .tabbar { background: var(--card); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.mt { margin-top: 12px; }
/* Tor ekranda segmented control keyingi qatorga tushadi */
.setting-row { flex-wrap: wrap; }
.setting-row > .grow.title { min-width: max-content; }
.setting-row > .seg { margin-left: auto; }

/* ---------- Admin dashboard ---------- */
.period-seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin-bottom: 12px; }
.period-seg button { min-height: 40px; padding: 0 4px; }
.neg { color: var(--red) !important; }
.pos { color: var(--green); }
.warn-text { color: var(--orange); }

.profit-hero {
  padding: 18px 16px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, #0f6e6e 0%, var(--c-teal) 45%, var(--c-blue) 100%);
  box-shadow: var(--shadow-lg);
}
.profit-hero .label { font-size: 14px; font-weight: 700; opacity: 0.9; }
.profit-hero .value { margin: 2px 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.8px; }
.profit-hero .value.neg { color: #ffd2d5 !important; }
.chip.glass { background: rgba(255, 255, 255, 0.2); color: #fff; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; }
.delta span { font-weight: 600; opacity: 0.85; }
.money-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.money-flow > div { display: grid; gap: 1px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); min-width: 0; }
.money-flow span { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; opacity: 0.92; }
.money-flow b { font-size: 13.5px; font-weight: 800; overflow-wrap: anywhere; }
.money-flow small { font-size: 10.5px; opacity: 0.8; }
.money-flow i, .chart-legend i, .chart-tip i { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 3px; }
.money-flow i { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7); }
.warn-note {
  display: flex; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--text); font-size: 13px; font-weight: 600;
}
.warn-note .i { color: var(--orange); }
.kpi-value.sm { font-size: 19px; }

.chart-card { margin-top: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 8px; font-size: 12px; font-weight: 700; color: var(--hint); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-box { position: relative; overflow-x: auto; }
.chart-box svg { display: block; touch-action: pan-y; }
.grid-line { stroke: var(--sep); stroke-width: 1; }
.axis-label { fill: var(--hint); font: 600 10px var(--font); }
.col .seg { stroke: var(--card); stroke-width: 1; transition: opacity 0.15s ease; }
.col.dim .seg { opacity: 0.35; }
.chart-tip {
  position: absolute; top: 0; z-index: 2; min-width: 190px; padding: 10px 12px; border-radius: 12px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 12px; pointer-events: none;
}
.chart-tip > div { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.chart-tip span { display: inline-flex; align-items: center; gap: 6px; color: var(--hint); font-weight: 600; }
.chart-empty { padding: 28px 0; text-align: center; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 10px 8px 8px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--hint); white-space: nowrap; }
.data-table td { padding: 10px 8px; text-align: right; font-weight: 700; font-size: 12.5px; white-space: nowrap; border-top: 1px solid var(--sep); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }

.pstats-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.pstats-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.kv.money { margin-top: 8px; }
.kv dd.pos, .kv dd.neg { font-weight: 800; }

/* Paket muharriri: miqdor · narx · tannarx / belgi · o'chirish */
.package-row { grid-template-columns: 0.8fr 1.1fr 1.1fr; grid-template-areas: "q p c" "b b x"; }
.package-row > label:nth-child(1) { grid-area: q; }
.package-row > label:nth-child(2) { grid-area: p; }
.package-row > label:nth-child(3) { grid-area: c; }
.package-row > .badge-cell { grid-area: b; }
.package-row > .icon-btn { grid-area: x; justify-self: end; }

/* ---------- Kirish animatsiyasi (splash) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background:
    radial-gradient(70% 45% at 50% 42%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    var(--bg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash-ring {
  position: absolute; top: 50%; left: 50%; width: 260px; height: 260px; margin: -160px 0 0 -130px;
  border-radius: 50%; background: var(--gold); opacity: 0.22;
  -webkit-mask: var(--girih) center / 52px 52px, radial-gradient(circle, transparent 38%, #000 40%, #000 68%, transparent 70%);
  -webkit-mask-composite: source-in;
  mask: var(--girih) center / 52px 52px, radial-gradient(circle, transparent 38%, #000 40%, #000 68%, transparent 70%);
  mask-composite: intersect;
  animation: ring-in 0.8s ease-out both, spin 14s linear infinite;
}
.splash-mark {
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; color: #fff;
  background: var(--grad-brand); box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: mark-in 0.8s cubic-bezier(0.2, 1.5, 0.4, 1) both, glow 2.4s ease-in-out 0.8s infinite;
}
.splash-mark .i { width: 58px; height: 58px; animation: star-in 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) 0.1s both; }
.splash-name { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.splash-name span { display: inline-block; animation: rise 0.6s ease-out both; }
.splash-name span:first-child { animation-delay: 0.35s; }
.splash-name .gold { color: var(--gold); animation-delay: 0.5s; }
.splash-dots { display: flex; gap: 6px; height: 8px; }
.splash-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); animation: dot 1.1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { animation-delay: 0.15s; }
.splash-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes ring-in { from { opacity: 0; transform: scale(0.7); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes mark-in { from { opacity: 0; transform: scale(0.3) rotate(-25deg); } }
@keyframes star-in { from { transform: rotate(-180deg) scale(0.2); } }
@keyframes glow { 50% { box-shadow: 0 18px 54px color-mix(in srgb, var(--accent-2) 55%, transparent); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes dot { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
