/* ============================================================
   Elder API v2 — design system
   Dark navy base, teal/cyan accent (SocGrow-style kabinet reference).
   ============================================================ */

:root {
  --bg: #0A0F1C;
  --surface: #111A2C;
  --surface-soft: #16223A;
  --surface-sunken: #1B2A45;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #F2F6FB;
  --text-soft: #C3CEE0;
  --text-muted: #8B9AB3;
  --text-faint: #5E6E88;

  --accent: #2DD4BF;
  --accent-hover: #22B8A6;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-ring: rgba(45, 212, 191, 0.28);

  --success: #34D399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --danger: #F87171;
  --danger-hover: #EF4444;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --info: #60A5FA;
  --info-soft: rgba(96, 165, 250, 0.14);

  --sidebar: #070B14;
  --sidebar-soft: #101A2C;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-text: #A9B6CB;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.24);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.28), 0 14px 30px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 84px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Ambient background glow — bosh sahifadan tortib hamma joyda
   sekin "nafas oladigan" fon yorug'ligi, dizaynga chuqurlik va harakat
   beradi (statik-yassi ko'rinishdan chiqarish uchun) ---------- */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
body::before {
  top: -12%; left: -8%;
  width: 55vw; height: 55vw;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.16), transparent 70%);
  animation: ambient-drift 16s ease-in-out infinite;
}
body::after {
  bottom: -18%; right: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.10), transparent 70%);
  animation: ambient-drift 20s ease-in-out infinite reverse;
}
.app-shell, .auth-shell { position: relative; z-index: 1; }

@keyframes ambient-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4%, -3%) scale(1.12); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 0 rgba(45, 212, 191, 0); }
  50% { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 70px rgba(45, 212, 191, 0.22); }
}
@keyframes shine-sweep {
  from { transform: translateX(-160%) skewX(-20deg); }
  to { transform: translateX(260%) skewX(-20deg); }
}
@keyframes ring-pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(45, 212, 191, 0); }
}
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ============================================================
   Liquid Glass — iOS 26 uslubidagi shisha material.
   Ikki qatlam: (1) hamma joyda ishlaydigan bazaviy blur+saturate+gradient
   shisha (keng qo'llab-quvvatlanadi), (2) shu ustiga @supports orqali —
   faqat backdrop-filter'da SVG filter-referensni tushunadigan brauzerlarda —
   haqiqiy singan-yorug'lik distorsiyasi (feTurbulence+feDisplacementMap,
   base.html'dagi #glass-distortion) qo'shiladi. Qo'llab-quvvatlamasa ham
   bazaviy shisha ko'rinishi buzilmaydi. ============================================================ */
.glass {
  position: relative;
  background: linear-gradient(165deg, rgba(17, 26, 44, 0.74), rgba(11, 17, 30, 0.58));
  backdrop-filter: blur(22px) saturate(1.6) brightness(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.6) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}
@supports (backdrop-filter: url(#a)) or (-webkit-backdrop-filter: url(#a)) {
  .glass, .glass-strong {
    backdrop-filter: url(#glass-distortion) blur(14px) saturate(1.6) brightness(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.6) brightness(1.08);
  }
}
.glass::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.02) 45%, transparent 65%);
  mix-blend-mode: overlay;
}
.glass > * { position: relative; z-index: 1; }

.auth-body {
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(45, 212, 191, 0.14), transparent 60%),
    radial-gradient(900px 480px at 108% 8%, rgba(45, 212, 191, 0.08), transparent 55%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent-ring); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.auth-shell { display: block; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 10px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s var(--ease-out);
}
.brand:hover { transform: scale(1.06); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #5EEAD4, var(--accent));
  color: #062420;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #5EEAD4, var(--accent));
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 14px;
}

.nav { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 4px; }

.nav-link, .logout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 54px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 10px;
  text-align: center;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.16s var(--ease-out);
}
.nav-link .ico, .logout .ico { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; transition: opacity 0.2s ease, transform 0.2s var(--ease-out); }
.nav-link:hover { background: rgba(45, 212, 191, 0.08); color: #fff; }
.nav-link:hover .ico { opacity: 1; transform: scale(1.1); }
.nav-link.active {
  background: var(--accent-soft);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.35);
}
.nav-link.active .ico { opacity: 1; color: #5EEAD4; }

.sidebar-footer { margin-top: auto; width: 100%; }
.logout {
  border-color: var(--sidebar-line);
  background: rgba(255, 255, 255, 0.04);
}
.logout:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }

.content {
  min-width: 0;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px calc(40px + env(safe-area-inset-bottom));
}
.content-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  max-width: none;
}

/* ---------- Typography ---------- */
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-weight: 750; }
h1 { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
h2 { font-size: 16px; line-height: 1.3; }
h3 { font-size: 14px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow a { color: var(--accent); }
.lead { margin: 6px 0 0; color: var(--text-muted); line-height: 1.6; font-size: 13.5px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */
.button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 650;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.22s ease, transform 0.16s var(--ease-out);
}
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-140%) skewX(-20deg);
}
.button:hover::before { animation: shine-sweep 0.85s ease; }
.button:hover { background: var(--accent-hover); box-shadow: 0 8px 22px rgba(45, 212, 191, 0.32); transform: translateY(-1px); }
.button:active { transform: scale(0.965) translateY(0); }
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.button:disabled::before { display: none; }

.button-muted {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text-soft);
}
.button-muted:hover { background: var(--surface-soft); border-color: var(--text-faint); color: var(--text); box-shadow: var(--shadow-sm); }

.button-danger { background: var(--danger); }
.button-danger:hover { background: var(--danger-hover); box-shadow: 0 8px 22px rgba(248, 113, 113, 0.32); }

.button-block { width: 100%; }

/* ---------- Forms ---------- */
form { display: flex; flex-direction: column; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 600; font-size: 13px; color: var(--text-soft); }

input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
textarea { padding: 10px 12px; min-height: 84px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, textarea:hover, select:hover { border-color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
input[type="file"] {
  padding: 7px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-soft);
  border-style: dashed;
}
input[type="file"]:hover { background: var(--surface-sunken); border-color: var(--accent); }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
input[type="file"]:hover::file-selector-button { background: var(--accent); color: #fff; }

.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 550;
}
.field-error::before {
  content: "";
  flex-shrink: 0;
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}

/* ---------- Panels & cards ---------- */
.panel {
  position: relative;
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  animation: fade-up 0.5s var(--ease-out) both;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.28s ease;
}
.panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.panel:last-child { margin-bottom: 0; }

/* bitta konteynerda ketma-ket paneller — bosqichma-bosqich paydo bo'lish */
.dash-grid > *:nth-child(1) { animation-delay: 0.02s; }
.dash-grid > *:nth-child(2) { animation-delay: 0.09s; }
.stats-grid > *:nth-child(1) { animation-delay: 0.02s; }
.stats-grid > *:nth-child(2) { animation-delay: 0.08s; }
.stats-grid > *:nth-child(3) { animation-delay: 0.14s; }
main.content > .panel:nth-of-type(1) { animation-delay: 0.05s; }
main.content > .panel:nth-of-type(2) { animation-delay: 0.12s; }
main.content > .panel:nth-of-type(3) { animation-delay: 0.19s; }
main.content > section:nth-of-type(1) { animation: fade-up 0.5s var(--ease-out) both; animation-delay: 0.02s; }
main.content > section:nth-of-type(2) { animation: fade-up 0.5s var(--ease-out) both; animation-delay: 0.1s; }
main.content > header.page-head { animation: fade-up 0.45s var(--ease-out) both; }
.panel::-webkit-scrollbar { height: 6px; }
.panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

/* ---------- Grids ---------- */
.split, .docs-grid, .api-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}
.split > *, .stats-grid > *, .api-grid > *, .docs-grid > * { min-width: 0; }
.api-grid .panel, .stats-grid .panel { margin-bottom: 0; }

/* ---------- Dashboard hero ---------- */
.dash-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: 16px;
  align-items: stretch;
}
.dash-grid > * { min-width: 0; margin-bottom: 0; }

/* Balans kartasi — Mercury/Wise uslubidagi zamonaviy fintech dizayni:
   yorqin gradient/porlash o'rniga TEKIS sirt (boshqa kartalar bilan bir
   xil), katta-oddiy raqam bosh e'tibor markazi, kichik sparkline grafik
   qo'shimcha kontekst beradi. */
.balance-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.55s var(--ease-out) both;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), border-color 0.24s ease;
}
.balance-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.balance-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.balance-card-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.balance-card-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}

/* Muddat-tanlash (Bugun/Kecha/Bu hafta/Bu oy) yopiladigan menyu — balans
   kartasida VA admin "Top hamkor" bo'limida ishlatiladi (period-dropdown.js). */
.period-dropdown { position: relative; }
.period-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
  padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-sunken); color: var(--text-muted);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.period-dropdown-trigger:hover { color: var(--text); border-color: var(--line-strong, var(--line)); }
.period-dropdown-trigger[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.period-dropdown-chevron { transition: transform 0.15s ease; flex-shrink: 0; }
.period-dropdown-trigger[aria-expanded="true"] .period-dropdown-chevron { transform: rotate(180deg); }
.period-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  min-width: 132px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md, 0 12px 28px rgba(0,0,0,0.18));
  display: flex; flex-direction: column; gap: 1px;
}
/* [hidden] muhim: "display: flex" author qoidasi UA stilidagi
   "[hidden]{display:none}"dan kuchliroq (author > UA cascade'da), shu
   sabab JS'dagi menu.hidden=true HECH QACHON ko'rinishga ta'sir qilmasdi
   — menyu doim ochiq ko'rinardi. Bu qoida aniq ustunlik beradi. */
.period-dropdown-menu[hidden] { display: none; }
.period-dropdown-item {
  display: block; width: 100%; text-align: left;
  font-size: 12.5px; font-weight: 550; color: var(--text-muted);
  padding: 7px 9px; border-radius: 6px; border: none; background: none; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.period-dropdown-item:hover { background: var(--surface-sunken); color: var(--text); }
.period-dropdown-item.is-active { color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.period-dropdown.is-loading .period-dropdown-trigger { opacity: 0.6; pointer-events: none; }
.balance-card-mark {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--surface-sunken);
  color: var(--text-muted);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s var(--ease-out);
}
.balance-card-mark:hover { background: var(--accent-soft); color: var(--accent); transform: scale(1.06); }
.balance-card-mark:active { transform: scale(0.94); }
.balance-card-mark svg { width: 15px; height: 15px; }
.balance-card-amount {
  font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.balance-card-amount small { font-size: 16px; font-weight: 600; color: var(--text-muted); }
.balance-card-trend { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.balance-card-period { color: var(--text-faint); }
.trend-figure { font-weight: 650; font-variant-numeric: tabular-nums; }
.trend-up { color: var(--success); }
.trend-down { color: var(--text-muted); }
.balance-sparkline { display: block; width: 100%; height: 48px; margin: 2px 0 4px; }
.balance-sparkline-fill { fill: var(--accent); opacity: 0.10; }
.balance-sparkline-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.balance-card-btn { align-self: flex-start; background: var(--accent); color: #062420; }
.balance-card-btn:hover { background: var(--accent-hover); box-shadow: 0 10px 26px rgba(45, 212, 191, 0.4); transform: translateY(-1px); }

/* ---------- Bento price tiles (dashboard) ---------- */
.bento-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.price-tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.5s var(--ease-out) both;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), border-color 0.24s ease;
}
.price-tile:hover { transform: translateY(-2px); border-color: rgba(45, 212, 191, 0.35); box-shadow: var(--shadow); }
.bento-prices > *:nth-child(1) { animation-delay: 0.04s; }
.bento-prices > *:nth-child(2) { animation-delay: 0.08s; }
.bento-prices > *:nth-child(3) { animation-delay: 0.12s; }
.bento-prices > *:nth-child(4) { animation-delay: 0.16s; }
.price-tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.price-tile-icon svg { width: 16px; height: 16px; }
.price-tile-label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.price-tile-value { font-size: 14.5px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price-tile-value small { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ---------- Bento stat row (dashboard, row 2) ---------- */
.dash-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.bento-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.5s var(--ease-out) both;
  transition: transform 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out), border-color 0.24s ease;
}
.bento-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.dash-stats-row > *:nth-child(1) { animation-delay: 0.08s; }
.dash-stats-row > *:nth-child(2) { animation-delay: 0.13s; }
.bento-cell-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.bento-cell-icon svg { width: 20px; height: 20px; }
.bento-cell-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bento-cell-label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.bento-cell-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bento-cell-sub { color: var(--text-faint); font-size: 12px; }
.bento-cell-link { flex-shrink: 0; color: var(--accent); font-weight: 650; font-size: 13px; white-space: nowrap; transition: opacity 0.16s ease; }
.bento-cell-link:hover { opacity: 0.78; }

.bento-apikey { flex-direction: column; align-items: stretch; gap: 12px; }
.bento-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bento-apikey .api-key { margin: 0; }

/* API key row */
.apikey-row { display: flex; align-items: center; gap: 8px; }
.apikey-row .api-key { flex: 1; min-width: 0; margin: 0; }
.icon-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.12s var(--ease-out);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- Stat cards ---------- */
.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.5s var(--ease-out) both;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.28s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(45, 212, 191, 0.35); }
.stat-card > span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.stat-card > strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-card > small { color: var(--text-faint); font-size: 12px; }

/* ---------- Admin — to'liq dashboard (stat kartalar, grafik, top-10) ---------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.admin-stats-grid > * { min-width: 0; margin-bottom: 0; }
.admin-stats-grid > *:nth-child(1) { animation-delay: 0.02s; }
.admin-stats-grid > *:nth-child(2) { animation-delay: 0.06s; }
.admin-stats-grid > *:nth-child(3) { animation-delay: 0.1s; }
.admin-stats-grid > *:nth-child(4) { animation-delay: 0.14s; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-top: 8px;
}
.bar-chart-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.bar-chart-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar-chart-bar {
  width: 100%;
  min-height: 3px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  background: var(--line-strong);
  transition: height 0.4s var(--ease-out);
}
.bar-chart-bar-completed { background: var(--accent); }
.bar-chart-bar-rest { background: var(--danger); opacity: 0.5; }
.bar-chart-label { font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.bar-chart-legend { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.bar-chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.chart-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chart-dot-completed { background: var(--accent); }
.chart-dot-rest { background: var(--danger); opacity: 0.5; }

.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.4s var(--ease-out) both;
}
.leaderboard-rank {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.leaderboard-rank.top3 { background: var(--accent-soft); color: var(--accent); }
.leaderboard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.leaderboard-body strong { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-body span { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-stats { flex-shrink: 0; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.leaderboard-stats strong { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.leaderboard-stats span { color: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.premium-card .price-stack { display: grid; gap: 8px; margin-top: 12px; }
.premium-card .price-row b {
  display: flex; justify-content: space-between; gap: 10px;
  font-weight: 650; font-size: 13.5px;
}
.premium-card .price-row b small { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  padding: 0 12px 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-soft); }

/* ---------- Orders — row list (instead of bare table) ---------- */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.4s var(--ease-out) both;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s ease;
}
.order-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.order-row-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cbg);
  color: var(--c);
}
.order-row-icon svg { width: 17px; height: 17px; }
.order-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-row-body strong { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row-body span { color: var(--text-muted); font-size: 12px; text-transform: capitalize; }
.order-row-price { flex-shrink: 0; font-size: 13.5px; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* ---------- Admin — order list + detail (faqat kuzatuv) ---------- */
.admin-lookup-form { display: flex; gap: 8px; max-width: 360px; margin-bottom: 18px; }
.admin-lookup-form input { flex: 1; }

.order-row.admin-order-row { cursor: pointer; }
.order-row-buyer {
  flex-shrink: 0; width: 120px; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.order-row-buyer strong, .order-row-buyer span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-row-buyer strong { font-size: 13px; font-weight: 650; }
.order-row-buyer span { color: var(--text-muted); font-size: 11.5px; }

.admin-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.admin-order-field { display: flex; flex-direction: column; gap: 3px; }
.admin-order-field strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.admin-order-field span { color: var(--text-muted); font-size: 12px; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 9px 0; }
.timeline-item:not(:last-child)::before {
  content: ""; position: absolute; left: 5px; top: 26px; bottom: -9px; width: 1px; background: var(--line-strong);
}
.timeline-dot { flex-shrink: 0; width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; background: var(--text-faint); }
.timeline-item.timeline-processing .timeline-dot { background: var(--accent); }
.timeline-item.timeline-debited .timeline-dot, .timeline-item.timeline-refunded .timeline-dot { background: var(--warning); }
.timeline-item.timeline-completed .timeline-dot { background: var(--success); }
.timeline-item.timeline-failed .timeline-dot { background: var(--danger); }
.timeline-body { display: flex; flex-direction: column; gap: 2px; }
.timeline-body strong { font-size: 13.5px; font-weight: 650; }
.timeline-body span { font-size: 12.5px; color: var(--text-muted); }
.timeline-body small { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.load-more-wrap { display: flex; justify-content: center; margin-top: 14px; }
.load-more-wrap .button { min-width: 180px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  text-transform: capitalize;
}
.badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.badge-paid, .badge-completed, .badge-done, .badge-approved {
  background: var(--success-soft); border-color: rgba(52, 211, 153, 0.3); color: var(--success);
}
.badge-pending, .badge-queued, .badge-processing, .badge-open {
  background: var(--warning-soft); border-color: rgba(251, 191, 36, 0.3); color: var(--warning);
  animation: badge-breathe 1.8s ease-in-out infinite;
}
.badge-rejected, .badge-failed, .badge-error {
  background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.3); color: var(--danger);
}
.badge-expired, .badge-cancelled, .badge-closed {
  background: var(--surface-sunken); border-color: var(--line-strong); color: var(--text-muted);
}

/* ---------- Code / API key ---------- */
code, pre, .api-key {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
.api-key {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-soft);
  font-size: 12.5px;
  overflow-x: auto;
  white-space: nowrap;
}
pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #0f1419;
  color: #e6edf3;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
}
pre code { color: inherit; }
.code-block { position: relative; }
.code-block .copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #c4ccd6;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s var(--ease-out);
}
.code-block .copy-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.code-block .copy-btn:active { transform: scale(0.92); }
.code-block .copy-btn.copied { color: #4ade80; border-color: rgba(74, 222, 128, 0.5); }
.icon-btn.copied { color: var(--success); border-color: var(--success); }

/* ---------- Admin: receipt list & pricing form ---------- */
.pricing-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: end;
}
.pricing-form .button { grid-column: 1 / -1; justify-self: start; }

.receipt-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.receipt-item {
  display: grid; gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.receipt-meta { display: grid; gap: 8px; }
.receipt-meta > strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.receipt-meta > span { color: var(--text-muted); font-size: 13px; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions input { flex: 1; min-width: 0; min-height: 38px; }
.receipt-preview img {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block;
}

/* ---------- Login (user) ---------- */
.login-redesign {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 18px;
  align-items: stretch;
}
.login-card, .login-pricing, .login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-main { padding: 32px; display: flex; flex-direction: column; gap: 26px; }
.login-mark { display: flex; align-items: center; gap: 14px; }
.login-mark img { width: 46px; height: 46px; border-radius: 11px; }
.login-kicker { color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.login-mark h1 { font-size: 24px; }
.login-access { display: flex; flex-direction: column; gap: 16px; }
.login-access h2 { font-size: 15px; color: var(--text-soft); }

.login-pricing { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.login-pricing-head { display: flex; align-items: center; justify-content: space-between; }
.login-pricing-head h2 { font-size: 15px; }
.login-pricing-head span {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 3px 9px; border-radius: var(--radius-pill);
}
.login-price-list { display: grid; gap: 2px; }
.login-price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.login-price-row:last-child { border-bottom: 0; }
.login-price-row span { color: var(--text-muted); font-size: 13.5px; }
.login-price-row strong { font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Login (admin) centered ---------- */
.login-layout { width: 100%; max-width: 380px; }
.login-panel { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-panel .button { margin-top: 4px; }

/* ---------- Notices / toasts ---------- */
.notice {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: 20px;
  left: auto;
  z-index: 999;
  max-width: 360px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
  animation: notice-in 0.32s var(--ease-out), notice-out 0.4s ease 4s forwards;
}
@keyframes notice-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes notice-out { to { opacity: 0; transform: translateY(14px); } }
@keyframes badge-breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.25); }
  50% { opacity: 0.82; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0); }
}
.notice-success { border-color: rgba(52, 211, 153, 0.32); background: var(--success-soft); color: var(--success); }
.notice-error { border-color: rgba(248, 113, 113, 0.3); background: var(--danger-soft); color: var(--danger); }

/* Push permission prompt */
.push-prompt {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 998;
  width: min(320px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}
.push-prompt.show { opacity: 1; transform: none; }
.push-prompt-text { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.push-prompt-text strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.push-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; }
.push-prompt-actions .button { min-height: 36px; padding: 0 14px; }

@media (max-width: 760px) {
  .push-prompt { left: 16px; right: 16px; width: auto; bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   Balance — reservation flow
   ============================================================ */
/* Mobil'da bitta ustun (540px — telefon kengligidan baribir katta, shart
   emas), lekin desktopda .dash-grid bilan bir xil g'oyada 2-ustunli grid:
   chapda amal (rezervatsiya/to'lov formasi), o'ngda tarix — avval BUTUN
   sahifa 540px'ga qisilib, katta monitorda bo'sh joy qolardi. */
.balance-layout { display: flex; flex-direction: column; gap: 16px; max-width: 540px; }
.balance-col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.balance-col-history { margin-bottom: 0; min-width: 0; }

@media (min-width: 761px) {
  .balance-layout {
    max-width: 1180px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    gap: 20px;
  }
}

.reserve-panel { gap: 16px; display: flex; flex-direction: column; animation: panel-in 0.3s var(--ease-out) both; }
@keyframes panel-in {
  from { opacity: 0; transform: scale(0.98) translateY(8px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.reserve-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reserve-note { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.amount-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s var(--ease-out);
}
.amount-chip:hover { border-color: var(--accent); color: var(--text); }
.amount-chip:active { transform: scale(0.95); }
.amount-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.topup-method-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.topup-tab {
  flex: 1; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-soft); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.topup-tab:hover { border-color: var(--accent); color: var(--text); }
.topup-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.countdown {
  min-width: 78px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--warning-soft);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning);
  font-size: 18px; font-weight: 800; text-align: center;
  font-variant-numeric: tabular-nums;
}
.countdown.countdown-low {
  background: var(--danger-soft); border-color: rgba(248, 113, 113, 0.35); color: var(--danger);
  animation: countdown-pulse 0.9s ease-in-out infinite;
}
@keyframes countdown-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.04); } }

.copy-field {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.copy-field-body { flex: 1; min-width: 0; }
.copy-field-label {
  display: block; margin-bottom: 3px;
  color: var(--accent); font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.copy-field-body strong {
  display: block; color: var(--text);
  font-size: 20px; font-weight: 800; line-height: 1.2;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.copy-field-primary { border-color: rgba(45, 212, 191, 0.28); background: var(--accent-soft); }
.copy-field-primary .copy-field-body strong { font-size: 27px; letter-spacing: -0.01em; }
.copy-field-primary .copy-icon { border-color: rgba(45, 212, 191, 0.28); }

.copy-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, transform 0.12s var(--ease-out);
}
.copy-icon:hover { border-color: var(--accent); color: var(--accent); }
.copy-icon:active { transform: scale(0.9); }
.copy-icon.copied { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.copy-icon svg { display: block; }
/* eye.svg (masalan API kalitni ko'rsatish/yashirish tugmasi) o'zining
   width/height atributiga ega emas (faqat "ico" klass bilan, u faqat
   .nav-link/.mobile-tab ichida o'lchamlanadi) — shu yerda ham aniq
   o'lchamlanmasa, brauzer standart (juda katta) o'lchamda chizadi. */
.copy-icon svg.ico { width: 18px; height: 18px; }
.copy-icon.copied svg { animation: copy-pop 0.26s var(--ease-out); }
@keyframes copy-pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================
   Gifts catalog
   ============================================================ */
.balance-pill {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.gift-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
}

.gift-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: center;
  transition: transform 0.16s var(--ease-out), box-shadow 0.18s ease, border-color 0.16s ease;
}
.gift-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.gift-card:active { transform: translateY(-1px) scale(0.99); }

.gift-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(251, 191, 36, 0.16); color: #FBBF24;
  font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}

.gift-anim {
  width: 112px; height: 112px;
  display: grid; place-items: center;
  margin-bottom: 6px;
  overflow: hidden;
}
.gift-anim svg, .gift-anim canvas { width: 100% !important; height: 100% !important; display: block; }
.gift-emoji { font-size: 56px; line-height: 1; }
.gift-anim-lg { width: 128px; height: 128px; margin: 0 auto 8px; }
.gift-anim-lg .gift-emoji { font-size: 76px; }

.gift-price { font-size: 15px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.gift-stars { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.gift-idrow {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 8px;
  padding: 2px 2px 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.gift-idrow:hover { border-color: var(--accent); }
.gift-idrow:active { transform: scale(0.99); }
.gift-idrow.copied { border-color: rgba(21,128,61,.35); background: var(--success-soft); }
.gift-idrow.copied .gift-cid { color: var(--success); }
.gift-idrow.copied .gift-copy { color: var(--success); }
.gift-idrow.copied .gift-copy svg { display: none; }
.gift-idrow.copied .gift-copy::after { content: "✓"; font-size: 13px; font-weight: 800; }
.gift-cid {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gift-copy {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
}
.gift-idrow:hover .gift-copy { color: var(--accent); }

/* Modal */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(15, 23, 41, 0.5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  position: relative;
  width: min(380px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.24s var(--ease-out);
}
.modal-backdrop.show .modal { transform: none; }
.modal h2 { font-size: 17px; }
.modal form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; text-align: left; }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-size: 15px;
  transition: background 0.16s ease, color 0.16s ease;
}
.modal-close:hover { background: var(--surface-soft); color: var(--text); }
.gm-meta { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.gm-meta > span:first-child { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gm-id {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: center;
  margin: 2px auto 0;
  padding: 4px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  font-size: 11px; color: var(--text-muted);
  font-family: ui-monospace, monospace;
  cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.gm-id::after { content: "⧉"; font-size: 12px; }
.gm-id:hover { border-color: var(--accent); color: var(--accent); }
.gm-id.copied { border-color: rgba(21,128,61,.3); color: var(--success); }
.gm-id.copied::after { content: "✓"; }

/* ============================================================
   API docs (zamonaviy, bo'limlarga rangli)
   ============================================================ */
.connection-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.connection-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.connection-row .k-label { flex-shrink: 0; width: 80px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.connection-row code { flex: 1; min-width: 140px; overflow-x: auto; white-space: nowrap; font-size: 12.5px; color: var(--text-soft); font-family: ui-monospace, monospace; }
.connection-row .copy-icon { flex-shrink: 0; width: 32px; height: 32px; }

.api-group-title {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.api-sections + .api-group-title { margin-top: 26px; }

.api-sections { display: grid; gap: 16px; margin-bottom: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.api-sections:last-child { margin-bottom: 0; }
.api-sections > .wide { grid-column: 1 / -1; }
.api-sections > * { min-width: 0; }

.api-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
  --c: #2DD4BF; --cbg: rgba(45, 212, 191, 0.12);
}
.api-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.api-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px 13px 18px;
  background: var(--cbg); border-bottom: 1px solid var(--line);
}
.api-card-head h2 { font-size: 13.5px; font-family: ui-monospace, monospace; font-weight: 700; color: var(--text); letter-spacing: 0; }
.api-card-body { padding: 14px 16px; }
.api-card-body pre { margin-top: 10px; }
.method {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em;
  color: #061018; background: var(--c);
}
.tag-public { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--c); background: var(--surface); padding: 2px 9px; border-radius: var(--radius-pill); border: 1px solid var(--c); }

.api-params { width: 100%; margin-top: 10px; font-size: 12px; }
.api-params td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.api-params tr:last-child td { border-bottom: 0; }
.api-params td:first-child { font-family: ui-monospace, monospace; color: var(--c); font-weight: 600; white-space: nowrap; }

.c-green  { --c: #34D399; --cbg: rgba(52, 211, 153, 0.12); }
.c-teal   { --c: #2DD4BF; --cbg: rgba(45, 212, 191, 0.12); }
.c-indigo { --c: #818CF8; --cbg: rgba(129, 140, 248, 0.12); }
.c-rose   { --c: #FB7185; --cbg: rgba(251, 113, 133, 0.12); }
.c-purple { --c: #A78BFA; --cbg: rgba(167, 139, 250, 0.12); }
.c-slate  { --c: #94A3B8; --cbg: rgba(148, 163, 184, 0.12); }

/* getInfo RPS segment */
.rps-box { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.rps-current { font-size: 13px; color: var(--text-soft); }
.rps-current b { color: var(--c); }
.rps-seg { display: flex; gap: 8px; }
.rps-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .12s var(--ease-out);
}
.rps-opt:hover { border-color: var(--c); }
.rps-opt:active { transform: scale(.98); }
.rps-opt.active { border-color: var(--c); background: var(--cbg); cursor: default; box-shadow: inset 0 0 0 1px var(--c); }
.rps-opt .rps-n { font-size: 17px; font-weight: 800; color: var(--text); }
.rps-opt .rps-p { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rps-opt.active .rps-n { color: var(--c); }
.rps-opt.active .rps-p { color: var(--c); }

/* ---------- Utilities ---------- */
.hide-mobile { } /* visible on desktop; hidden in mobile breakpoint below */

/* ============================================================
   Liquid Glass surfaces — hamma asosiy panel/karta/modal/sidebar bir xil
   shisha-material qatlamiga o'tkaziladi (component qoidalaridan KEYIN
   turadi, shu bilan background/border/box-shadow'ni override qiladi,
   boshqa xususiyatlari — padding, animation, hover — tegilmaydi). ============================================================ */
.panel, .stat-card, .price-tile, .bento-cell, .order-row, .leaderboard-row,
.login-card, .login-pricing, .login-panel,
.modal, .receipt-item {
  position: relative;
}
.panel, .stat-card, .price-tile, .bento-cell, .order-row, .leaderboard-row, .sidebar,
.login-card, .login-pricing, .login-panel,
.modal, .notice, .push-prompt, .receipt-item {
  isolation: isolate;
  background: linear-gradient(165deg, rgba(17, 26, 44, 0.74), rgba(11, 17, 30, 0.58));
  backdrop-filter: blur(22px) saturate(1.6) brightness(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.6) brightness(1.08);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.2), var(--shadow-sm);
}
.stat-card:hover, .panel:hover, .price-tile:hover, .bento-cell:hover, .order-row:hover, .leaderboard-row:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.2), var(--shadow-lg); }
@supports (backdrop-filter: url(#a)) or (-webkit-backdrop-filter: url(#a)) {
  .panel, .stat-card, .price-tile, .bento-cell, .order-row, .leaderboard-row, .sidebar,
  .login-card, .login-pricing, .login-panel,
  .modal, .notice, .push-prompt, .receipt-item {
    backdrop-filter: url(#glass-distortion) blur(13px) saturate(1.6) brightness(1.08);
    -webkit-backdrop-filter: blur(13px) saturate(1.6) brightness(1.08);
  }
}
/* isolation:isolate yuqorida bu 4 tasiga o'z stacking-context beradi, shuning
   uchun ::before'ga MANFIY z-index yetarli — ichidagi oddiy (static) content
   ustidan chiqib ketmaydi, mavjud position:absolute elementlarga (masalan
   .modal-close) esa umuman tegilmaydi (ularning o'z qatlamlanishi buzilmaydi). */
.panel::before, .stat-card::before, .price-tile::before, .bento-cell::before, .order-row::before, .leaderboard-row::before, .sidebar::before, .modal::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 45%, transparent 65%);
  mix-blend-mode: overlay;
}

/* ============================================================
   Responsive — tablet & mobile
   ============================================================ */
@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .premium-card { grid-column: 1 / -1; }
  .login-redesign { grid-template-columns: 1fr; max-width: 460px; }
}

/* Mobil "liquid glass" suzuvchi tab-bar — desktopda yashirin */
.mobile-tabbar { display: none; }

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }

  /* Eski yuqori bar (sidebar) mobil'da BUTUNLAY olib tashlanadi */
  .sidebar { display: none; }

  /* ---------- Pastki menu — "Liquid Glass" (iOS 26 uslubi) suzuvchi pill panel ----------
     Qatlamlar: (1) backdrop-filter — orqadagi kontentni xiralashtirib-to'yintiradi,
     (2) ::before — yuqoridan pastga yorug'lik-sheen (shisha egriligini simulyatsiya),
     (3) ikki xil qalinlikdagi border + ikkita box-shadow — tashqi ko'tarilish +
     ichki chekka-yaltirash (shisha qirrasi yorug'lik tutgandek). */
  .mobile-tabbar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 60;
    padding: 6px;
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
    background: rgba(20, 24, 32, 0.42);
    -webkit-backdrop-filter: blur(34px) saturate(2.4) brightness(1.06);
    backdrop-filter: blur(34px) saturate(2.4) brightness(1.06);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
      0 14px 40px rgba(0, 0, 0, 0.34),
      0 2px 8px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.35),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  }
  /* haqiqiy iOS 26 singan-yorug'lik distorsiyasi — faqat qo'llab-quvvatlagan
     brauzerlarda (base.html'dagi #glass-distortion SVG filtri) */
  @supports (backdrop-filter: url(#a)) or (-webkit-backdrop-filter: url(#a)) {
    .mobile-tabbar {
      backdrop-filter: url(#glass-distortion) blur(20px) saturate(2.4) brightness(1.06);
      -webkit-backdrop-filter: blur(20px) saturate(2.4) brightness(1.06);
    }
  }
  .mobile-tabbar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.20) 0%,
      rgba(255, 255, 255, 0.05) 35%,
      rgba(255, 255, 255, 0) 60%,
      rgba(0, 0, 0, 0.06) 100%);
    mix-blend-mode: overlay;
  }
  .mobile-tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 9.5px;
    font-weight: 650;
    letter-spacing: 0.01em;
    transition: background 0.16s var(--ease-out), color 0.16s ease, transform 0.12s var(--ease-out);
  }
  .mobile-tab .ico { width: 21px; height: 21px; opacity: 0.85; transition: opacity 0.16s ease, transform 0.16s var(--ease-out); }
  .mobile-tab:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.12); }
  .mobile-tab.active {
    background: linear-gradient(160deg, rgba(45, 212, 191, 0.30), rgba(255, 255, 255, 0.10));
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(45, 212, 191, 0.3),
      0 4px 14px rgba(45, 212, 191, 0.25);
  }
  .mobile-tab.active .ico { opacity: 1; color: #5EEAD4; animation: pop-in 0.35s var(--ease-out); }

  .content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  h1 { font-size: 22px; }

  .split, .docs-grid, .api-grid, .stats-grid, .dash-grid, .dash-stats-row, .api-sections { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api-sections > .wide { grid-column: auto; }
  .premium-card { grid-column: auto; }

  .balance-layout { max-width: none; }
  .hide-mobile { display: none !important; }

  .notice { left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); max-width: none; }
  .receipt-list { grid-template-columns: 1fr; }

  .admin-lookup-form { max-width: none; }

  /* order-row — tor ekranda icon+narx+badge bitta qatorda username/turi
     matnini siqib, qisqartirib (yoki hatto ellipsis'siz qirqib) yuborardi.
     2 qatorli grid'ga o'tkaziladi: 1-qator icon+matn (to'liq kenglik),
     2-qator narx+status (bir xil katakda, chap/o'ng chetga tekislangan) —
     shu orqali uzun username/summalar endi to'liq sig'adi. */
  .order-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-areas: "icon body" "icon meta";
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
  }
  .order-row-icon { grid-area: icon; }
  .order-row-body { grid-area: body; }
  .order-row-price {
    grid-area: meta;
    justify-self: start;
  }
  .order-row .badge {
    grid-area: meta;
    justify-self: end;
  }

  /* Admin qatorida hamkor (xaridor) ismi+username'i ham ko'rinishi kerak —
     o'z qatoriga chiqariladi (endi narx+badge alohida qatorga tushgani
     uchun joy bor), ism va username bitta qatorda yonma-yon. */
  .admin-order-row {
    grid-template-areas: "icon buyer" "icon body" "icon meta";
  }
  .order-row-buyer {
    display: flex;
    grid-area: buyer;
    flex-direction: row;
    align-items: baseline;
    width: auto;
    gap: 6px;
  }
  .order-row-buyer strong { flex-shrink: 1; min-width: 0; }
  .order-row-buyer span { flex-shrink: 2; min-width: 0; }

  /* leaderboard-row — order-row bilan bir xil saboq: narx/soni ustunini
     ismning yoniga siqib qo'ymasdan, boshidanoq 2 qatorli grid qilib
     quriladi (ism to'liq kenglikda, son+summa pastki qatorda). */
  .leaderboard-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-areas: "rank body" "rank stats";
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
  }
  .leaderboard-rank { grid-area: rank; }
  .leaderboard-body { grid-area: body; }
  .leaderboard-stats {
    grid-area: stats;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }

  .bar-chart { height: 130px; }
  .bar-chart-label { font-size: 9px; }
}

@media (max-width: 420px) {
  .content { padding: 16px 13px calc(96px + env(safe-area-inset-bottom)); }
  .panel { padding: 16px; border-radius: 12px; }
  h1 { font-size: 20px; }
  .stat-card > strong { font-size: 24px; }
  .copy-field-primary .copy-field-body strong { font-size: 24px; }
  .login-main, .login-pricing, .login-panel { padding: 22px; }
  .admin-actions { flex-direction: column; }
  .admin-actions .button { width: 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
