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

/* Doimiy yorug' palitra — Telegram temasiga bog'liq emas */
:root {
  --bg: #f1f3f8;
  --card: #ffffff;
  --text: #14161b;
  --muted: #7b8494;
  --accent: #2990ff;
  --accent-text: #ffffff;

  --border: rgba(20, 22, 27, 0.08);
  --field: rgba(20, 22, 27, 0.05);
  --accent-soft: rgba(41, 144, 255, 0.11);
  --ring: rgba(41, 144, 255, 0.22);

  --g2: #7c5cf6;
  --g3: #22b8ee;
  --grad: linear-gradient(135deg, var(--g3), var(--accent) 45%, var(--g2));

  --success: #1fa971;
  --warn: #e08700;
  --danger: #e5484d;
  --info: #3b82f6;
  --violet: #8b5cf6;

  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -16px rgba(16, 24, 40, 0.12);
  --shadow-pop: 0 24px 48px -12px rgba(16, 24, 40, 0.24);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
}

html { color-scheme: light only; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fon: yumshoq gradient tuman */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(520px 300px at 12% -6%, var(--accent-soft), transparent 68%),
    radial-gradient(460px 280px at 98% -4%, rgba(139, 92, 246, 0.09), transparent 70%);
  pointer-events: none;
}

.hidden { display: none !important; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Gradient matn */
.grad-text { color: var(--accent); }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ================= Login (brauzer) ================= */

.login {
  position: fixed; inset: 0; z-index: 45;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
  background: var(--bg);
  overflow-y: auto;
}
.login-box { width: 100%; max-width: 400px; text-align: center; animation: view-in 0.4s var(--ease); }
.login-logo { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; display: inline-flex; align-items: center; gap: 10px; }
.login-logo::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.login-tag { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

.login-card {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  margin-top: 24px;
  text-align: center;
}
.login-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 7px; }
.login-desc { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }
#login-btn svg { width: 18px; height: 18px; stroke-width: 2; }
.login-steps {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px;
  font-size: 11.5px; color: var(--muted); font-weight: 550;
}
.login-steps b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 750; margin-right: 4px;
}
.login-spinner { display: flex; justify-content: center; margin-bottom: 14px; }
.login-spinner .spinner { width: 30px; height: 30px; border-width: 3px; color: var(--accent); }
.login-cancel { color: var(--muted); }
.login-foot { color: var(--muted); font-size: 11.5px; line-height: 1.55; margin-top: 18px; padding: 0 10px; }
a.btn { text-decoration: none; }

/* ================= Gate ================= */

.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); z-index: 50; }
.gate-box { text-align: center; max-width: 300px; animation: view-in 0.4s var(--ease); }
.gate-logo { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.gate-box p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }

/* ================= Layout ================= */

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; animation: fade-in 0.3s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
}
.brand { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.brand::before {
  content: "";
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.balance-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  background: var(--grad);
  color: #fff;
  border-radius: 999px;
  font-weight: 700; font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px -8px var(--accent);
  transition: transform 0.12s var(--ease);
}
.balance-chip:active { transform: scale(0.95); }
.balance-chip svg { width: 15px; height: 15px; stroke-width: 2; }

.view { flex: 1; padding: 6px 18px calc(108px + env(safe-area-inset-bottom)); animation: view-in 0.24s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= Floating tabbar ================= */

.tabbar {
  position: fixed; z-index: 20;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  width: min(352px, calc(100% - 32px));
  display: flex; gap: 2px;
  padding: 5px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px;
  color: var(--muted);
  font-size: 10px; font-weight: 650; letter-spacing: 0.01em;
  border-radius: 19px;
  transition: color 0.18s, background 0.18s, transform 0.12s var(--ease);
}
.tab:active { transform: scale(0.94); }
.tab svg { width: 21px; height: 21px; transition: transform 0.2s var(--ease); }
.tab.active { color: var(--accent); background: var(--accent-soft); }
.tab.active svg { transform: translateY(-1px); }

/* ================= Search ================= */

.search-wrap { position: relative; margin-bottom: 14px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
#global-search {
  width: 100%; padding: 13px 40px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  outline: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#global-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
#global-search::placeholder { color: var(--muted); }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px; color: var(--muted); border-radius: 50%; }
.search-clear svg { width: 15px; height: 15px; }

/* ================= Platforma chiplar ================= */

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 18px 12px; margin: 0 -18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px;
  background: var(--card);
  border-radius: 999px;
  font-size: 13px; font-weight: 650; color: var(--text);
  box-shadow: var(--shadow-card);
  transition: background 0.16s, color 0.16s, transform 0.12s var(--ease), box-shadow 0.16s;
}
.chip:active { transform: scale(0.94); }
.chip svg { width: 14px; height: 14px; stroke-width: 2.1; }
.chip.active svg { color: inherit; }

.chip-all svg   { color: var(--accent); }
.chip-tg svg    { color: #229ed9; }
.chip-ig svg    { color: #e1306c; }
.chip-tt svg    { color: #00a6c0; }
.chip-yt svg    { color: #ff3b30; }
.chip-fb svg    { color: #1877f2; }
.chip-x svg     { color: var(--text); }
.chip-other svg { color: #10b981; }

.chip.active { color: #fff; }
.chip-all.active   { background: var(--grad); box-shadow: 0 8px 18px -8px var(--accent); }
.chip-tg.active    { background: #229ed9; box-shadow: 0 8px 18px -8px #229ed9; }
.chip-ig.active    { background: linear-gradient(45deg, #f09433, #dc2743 55%, #bc1888); box-shadow: 0 8px 18px -8px #dc2743; }
.chip-tt.active    { background: #00a6c0; box-shadow: 0 8px 18px -8px #00a6c0; }
.chip-yt.active    { background: #ff3b30; box-shadow: 0 8px 18px -8px #ff3b30; }
.chip-fb.active    { background: #1877f2; box-shadow: 0 8px 18px -8px #1877f2; }
.chip-x.active     { background: var(--text); color: var(--card); }
.chip-other.active { background: #10b981; box-shadow: 0 8px 18px -8px #10b981; }

/* ================= Pickers ================= */

.picker-group {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 14px;
}
.picker {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 15px; text-align: left;
  transition: background 0.13s;
}
.picker + .picker { border-top: 1px solid var(--border); }
.picker:active:not(:disabled) { background: var(--field); }
.picker:disabled { opacity: 0.45; cursor: default; }

.picker-ic {
  width: 40px; height: 40px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  flex-shrink: 0;
}
.picker-ic.v { background: rgba(139, 92, 246, 0.12); color: var(--violet); }
.picker-ic svg { width: 19px; height: 19px; stroke-width: 2; }

.picker-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.picker-label { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.picker-value { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker > svg { width: 16px; height: 16px; color: var(--muted); stroke-width: 2.2; transition: transform 0.2s var(--ease); }
.picker:active:not(:disabled) > svg { transform: translateX(2px); }

/* ================= Service card ================= */

.svc-card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
  overflow: hidden;
  animation: card-in 0.3s var(--ease);
}
.svc-card::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 3px;
  background: var(--grad);
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

.svc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 4px 9px; border-radius: 7px;
  background: var(--field); color: var(--muted);
}
.badge.b-accent { background: var(--accent-soft); color: var(--accent); }
.badge.b-green { background: rgba(31, 169, 113, 0.12); color: var(--success); }

.svc-name { font-weight: 650; font-size: 14.5px; line-height: 1.4; letter-spacing: -0.01em; margin-bottom: 14px; }

.svc-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.svc-price { display: flex; flex-direction: column; gap: 1px; }
.svc-price-label { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.svc-price-value { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.svc-limits { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.5; }
.svc-limits b { color: var(--text); font-weight: 650; }

/* ================= Form ================= */

.field { margin-bottom: 13px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 650; margin-bottom: 6px; letter-spacing: -0.005em; }
.field-label .opt { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  outline: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23828a96' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; padding-left: 2px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }

/* Dripfeed toggle */
.drip-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 15px; margin-bottom: 13px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  font-size: 13.5px; font-weight: 650; text-align: left;
  transition: transform 0.12s var(--ease);
}
.drip-toggle:active { transform: scale(0.99); }
.drip-toggle .switch {
  flex-shrink: 0;
  width: 42px; height: 26px; border-radius: 999px;
  background: var(--field); position: relative;
  transition: background 0.2s;
}
.drip-toggle .switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s var(--ease);
}
.drip-toggle.on .switch { background: var(--accent); }
.drip-toggle.on .switch::after { transform: translateX(16px); }
#drip-fields { animation: card-in 0.24s var(--ease); }

/* ================= Submit card ================= */

.submit-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-top: 4px;
}
.total-row { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 12px; }
.total-label { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.total-value {
  font-size: 23px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.total-value.pop { animation: pop 0.24s var(--ease); }
@keyframes pop { 40% { transform: scale(1.05); } }

/* ================= Buttons ================= */

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  border-radius: var(--r-md);
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  transition: transform 0.12s var(--ease), opacity 0.15s, filter 0.15s;
  overflow: hidden;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 12px 26px -10px var(--accent);
}
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.16), transparent 55%);
  pointer-events: none;
}
.btn-primary:active:not(:disabled) { filter: brightness(0.94); }
.btn-ghost { background: var(--field); color: var(--text); }
.btn-danger-ghost { background: rgba(229, 72, 77, 0.1); color: var(--danger); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 999px; width: auto; font-weight: 650; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid; border-color: currentColor currentColor currentColor transparent;
  opacity: 0.9;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Segmented ================= */

.seg { display: flex; gap: 2px; background: var(--field); border-radius: var(--r-md); padding: 3px; margin-bottom: 14px; }
.seg-btn {
  flex: 1; padding: 9px; border-radius: 11px;
  font-size: 13.5px; font-weight: 650; color: var(--muted);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(16, 24, 40, 0.12); }

/* ================= Lists ================= */

.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; min-height: 34px; }
.list-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.icon-btn {
  padding: 8px; border-radius: 50%;
  background: var(--card); color: var(--muted);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), color 0.15s;
}
.icon-btn:active { transform: rotate(160deg) scale(0.94); color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; display: block; }

/* ================= Order cards ================= */

.order-card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 15px 14px 18px;
  margin-bottom: 10px;
  overflow: hidden;
  animation: card-in 0.26s var(--ease) backwards;
}
.order-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--muted); opacity: 0.35;
}
.oc-pending::before   { background: var(--warn); opacity: 1; }
.oc-progress::before  { background: var(--info); opacity: 1; }
.oc-completed::before { background: var(--success); opacity: 1; }
.oc-canceled::before  { background: var(--danger); opacity: 1; }
.oc-partial::before   { background: var(--violet); opacity: 1; }

.order-card:nth-child(2) { animation-delay: 0.03s; }
.order-card:nth-child(3) { animation-delay: 0.06s; }
.order-card:nth-child(4) { animation-delay: 0.09s; }

.order-card { cursor: pointer; padding-right: 34px; transition: transform 0.12s var(--ease), background 0.13s; }
.order-card:active { transform: scale(0.985); background: var(--field); }
.order-mini {
  display: flex; gap: 5px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.order-mini span + span::before { content: "·"; margin-right: 5px; opacity: 0.6; }
.order-chev {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); opacity: 0.65; stroke-width: 2.2;
}
.confirm-row .v .status-pill { vertical-align: middle; }

.order-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.order-id { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.order-name { font-weight: 650; font-size: 14px; line-height: 1.4; letter-spacing: -0.01em; margin-bottom: 3px; }
.order-link { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.order-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  padding: 10px 12px;
  background: var(--field);
  border-radius: var(--r-sm);
}
.order-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.order-kv .k { color: var(--muted); }
.order-kv .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.order-live {
  margin-top: 10px; padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px;
  animation: card-in 0.22s var(--ease);
}

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-pending   { background: rgba(224, 135, 0, 0.12); color: var(--warn); }
.st-progress  { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.st-completed { background: rgba(31, 169, 113, 0.12); color: var(--success); }
.st-canceled  { background: rgba(229, 72, 77, 0.11); color: var(--danger); }
.st-partial   { background: rgba(139, 92, 246, 0.12); color: var(--violet); }
.st-other     { background: var(--field); color: var(--muted); }
.st-progress::before { animation: pulse 1.4s ease-in-out infinite; }
.st-pending::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ================= Sheet ================= */

.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 12, 16, 0.52);
  display: flex; align-items: flex-end;
  animation: fade-in 0.22s ease-out;
}
.sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  max-height: 88vh; max-height: 88dvh;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  animation: slide-up 0.42s var(--ease-sheet);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.2);
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
.overlay.closing { animation: fade-in 0.2s ease-in reverse forwards; }
.overlay.closing .sheet { animation: slide-down 0.2s cubic-bezier(0.4, 0, 1, 1) forwards; }
@keyframes slide-down { to { transform: translateY(100%); } }

.sheet-grip { width: 34px; height: 4px; border-radius: 999px; background: var(--field); margin: 9px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 10px; flex-shrink: 0; }
.sheet-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.sheet-search { padding: 0 18px 12px; flex-shrink: 0; }
.sheet-search input {
  width: 100%; padding: 11px 14px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.sheet-body { overflow-y: auto; padding: 0 18px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }

/* Row groups (sheet + qidiruv natijalari) */
.rows .row-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 15px; text-align: left;
  background: var(--card);
  border-radius: 0;
  transition: background 0.12s;
}
.rows .row-item:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.rows .row-item:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.rows .row-item:only-child { border-radius: var(--r-lg); }
.rows .row-item + .row-item { box-shadow: inset 0 1px 0 var(--border); }
.rows .row-item:active { background: var(--field); }
#search-results {
  margin-bottom: 14px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: card-in 0.22s var(--ease);
}

/* Kategoriya avatarlari */
.cat-ic {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-ic svg { width: 17px; height: 17px; stroke-width: 2; }
.ic-all   { background: var(--accent-soft); color: var(--accent); }
.ic-tg    { background: rgba(34, 158, 217, 0.12);  color: #229ed9; }
.ic-ig    { background: rgba(225, 48, 108, 0.11);  color: #e1306c; }
.ic-tt    { background: rgba(0, 166, 192, 0.12);   color: #00a6c0; }
.ic-yt    { background: rgba(255, 59, 48, 0.11);   color: #ff3b30; }
.ic-fb    { background: rgba(24, 119, 242, 0.11);  color: #1877f2; }
.ic-x     { background: var(--field);              color: var(--text); }
.ic-other { background: rgba(16, 185, 129, 0.12);  color: #10b981; }

.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 600; font-size: 13.5px; line-height: 1.4; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-variant-numeric: tabular-nums; }
.row-sub span + span::before { content: "·"; margin-right: 4px; opacity: 0.6; }
.row-side { text-align: right; flex-shrink: 0; }
.row-price { font-weight: 750; font-size: 13.5px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent); }
.row-note { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* Confirm sheet */
.confirm-list {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 4px 16px;
  margin-bottom: 14px;
}
.confirm-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; font-size: 13.5px; }
.confirm-row + .confirm-row { border-top: 1px solid var(--border); }
.confirm-row .k { color: var(--muted); flex-shrink: 0; }
.confirm-row .v { font-weight: 650; text-align: right; word-break: break-word; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.confirm-row .v.big { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.confirm-gap { height: 8px; }

/* Result */
.result-box { text-align: center; padding: 20px 0 10px; animation: card-in 0.3s var(--ease); }
.result-icon {
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  animation: pop-in 0.4s var(--ease) 0.05s backwards;
}
@keyframes pop-in { from { transform: scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.result-icon.ok { background: rgba(31, 169, 113, 0.13); color: var(--success); box-shadow: 0 0 0 10px rgba(31, 169, 113, 0.05); }
.result-icon.err { background: rgba(229, 72, 77, 0.12); color: var(--danger); box-shadow: 0 0 0 10px rgba(229, 72, 77, 0.05); }
.result-icon svg { width: 28px; height: 28px; stroke-width: 2.4; }
.result-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 5px; }
.result-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; line-height: 1.5; }

/* ================= Hisob ================= */

.account-hero {
  position: relative; overflow: hidden;
  background: var(--grad);
  border-radius: var(--r-xl);
  box-shadow: 0 18px 40px -16px var(--accent);
  padding: 24px 18px 18px;
  text-align: center;
  color: #fff;
  margin-bottom: 12px;
}
.account-hero::before {
  content: "";
  position: absolute;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  top: -130px; right: -70px;
  pointer-events: none;
}
.account-hero::after {
  content: "";
  position: absolute;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  bottom: -90px; left: -50px;
  pointer-events: none;
}
.account-avatar {
  position: relative; z-index: 1;
  width: 58px; height: 58px; border-radius: 50%;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 23px; font-weight: 800;
}
.account-name { position: relative; z-index: 1; font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.account-id { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, 0.75); font-variant-numeric: tabular-nums; margin: 2px 0 18px; }
.account-balance { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.account-balance-label { font-size: 11px; color: rgba(255, 255, 255, 0.72); font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; }
.account-balance-value { font-size: 36px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.account-hero .btn-primary {
  position: relative; z-index: 1;
  background: #fff; color: var(--accent);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35);
}
.account-hero .btn-primary::after { display: none; }
.account-hint { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, 0.72); margin-top: 10px; }

/* To'lovlar */
.subhead { display: flex; align-items: center; gap: 11px; margin: 2px 0 14px; }
.subhead-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
#deposit-back:active { transform: scale(0.92); }

.pay-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
}
.pay-card-title { font-size: 14.5px; font-weight: 750; letter-spacing: -0.01em; margin-bottom: 12px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--field);
  border-radius: var(--r-md);
  text-align: left;
  box-shadow: inset 0 0 0 2px transparent;
  transition: background 0.15s, transform 0.12s var(--ease), box-shadow 0.15s;
}
.pm-btn:active { transform: scale(0.96); }
.pm-btn.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.pm-ic {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pm-ic svg { width: 18px; height: 18px; stroke-width: 2; }
.pm-click  { background: rgba(0, 174, 239, 0.13);  color: #00aeef; }
.pm-payme  { background: rgba(0, 186, 186, 0.13);  color: #00b3b3; }
.pm-paynet { background: rgba(245, 130, 32, 0.13); color: #f58220; }
.pm-name { font-size: 12.5px; font-weight: 650; line-height: 1.25; letter-spacing: -0.005em; }
.pay-note { font-size: 11.5px; color: var(--muted); margin-top: 11px; line-height: 1.5; }

.pay-card .field input {
  background: var(--field);
  box-shadow: none;
}
.pay-card .field input:focus { box-shadow: 0 0 0 3px var(--ring); }
.pay-card .amount-chips { margin-bottom: 14px; }
.pay-card .amount-chip { background: var(--field); }
.pay-card .amount-chip.active { background: var(--accent); color: #fff; }

.apikey-box {
  background: var(--field);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 11px;
}
.apikey-box code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
  user-select: all;
  -webkit-user-select: all;
}

.pay-item {
  position: relative;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 13px 15px 13px 18px;
  margin-bottom: 10px;
  overflow: hidden;
  animation: card-in 0.26s var(--ease) backwards;
}
.pay-item::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--muted); opacity: 0.35;
}
.pay-item.pi-pending::before { background: var(--warn); opacity: 1; }
.pay-item.pi-paid::before    { background: var(--success); opacity: 1; }
.pay-item.pi-expired::before { background: var(--danger); opacity: 0.55; }
.pay-item:nth-child(2) { animation-delay: 0.03s; }
.pay-item:nth-child(3) { animation-delay: 0.06s; }

.pay-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.pay-amount { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pay-meta { font-size: 12px; color: var(--muted); display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.pay-meta span + span::before { content: "·"; margin-right: 5px; opacity: 0.6; }
.pay-left { color: var(--warn); font-weight: 650; }
.pay-actions { margin-top: 10px; display: flex; gap: 7px; }

/* Summa kiritish sheet */
.amount-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.amount-chip {
  padding: 8px 13px;
  background: var(--field);
  border-radius: 999px;
  font-size: 13px; font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, color 0.15s, transform 0.12s var(--ease);
}
.amount-chip:active { transform: scale(0.94); }
.amount-chip.active { background: var(--accent); color: #fff; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 8px 12px;
  text-align: center;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.stat-ic {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 5px;
}
.stat-ic svg { width: 16px; height: 16px; stroke-width: 2; }
.stat-ic.si-blue  { background: rgba(59, 130, 246, 0.12);  color: var(--info); }
.stat-ic.si-green { background: rgba(31, 169, 113, 0.12);  color: var(--success); }
.stat-ic.si-amber { background: rgba(224, 135, 0, 0.12);   color: var(--warn); }
.stat-value { font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 650; }

/* ================= Empty / skeleton ================= */

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty svg {
  width: 52px; height: 52px; padding: 14px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 17px;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.empty-title { font-weight: 700; color: var(--text); margin-bottom: 3px; letter-spacing: -0.01em; }
.empty p { font-size: 13px; }
.empty .spinner-lg {
  width: 24px; height: 24px; border-width: 3px;
  padding: 14px; box-sizing: content-box;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 17px;
  margin-bottom: 12px;
}

.skeleton {
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
  height: 96px; margin-bottom: 10px;
  position: relative; overflow: hidden;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--field) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ================= Toast ================= */

.toast-wrap {
  position: fixed; left: 16px; right: 16px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 420px; margin: 0 auto; width: fit-content;
  min-width: 200px;
  padding: 12px 18px;
  background: #1d2025; color: #fff;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600; text-align: center;
  letter-spacing: -0.005em;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.3s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
.toast.t-error { background: var(--danger); }
.toast.t-success { background: var(--success); }
.toast.leaving { transition: opacity 0.25s, transform 0.25s cubic-bezier(0.4, 0, 1, 1); opacity: 0; transform: translateY(10px) scale(0.97); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
