/* ============================================================
   HAMYON — dizayn
   Ranglar: lojuvard (lapis) tun, zar (oltin), firuza (daromad),
   anor (xarajat). Naqsh: sakkiz qirrali girih yulduzi.
   ============================================================ */
:root {
  --bg: #0E1633;
  --bg-2: #111B3E;
  --surface: #16214B;
  --surface-2: #1D2A5A;
  --line: rgba(164, 182, 255, .11);
  --line-2: rgba(164, 182, 255, .22);
  --text: #E9EDF8;
  --muted: #8F9AC0;
  --gold: #E8B04A;
  --gold-ink: #231703;
  --inc: #2BC4B0;
  --exp: #E4576A;
  --lapis: #5B7CFF;
  --shadow: 0 22px 44px -24px rgba(2, 6, 24, .8);
  --r-xl: 28px;
  --r-lg: 18px;
  --r-md: 12px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: 'Unbounded', 'Onest', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23E8B04A' stroke-width='1'%3E%3Crect x='16' y='16' width='32' height='32'/%3E%3Crect x='16' y='16' width='32' height='32' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='7'/%3E%3Cpath d='M0 0l10 10M64 0L54 10M0 64l10-10M64 64L54 54'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}
[data-theme=light] {
  --bg: #EEF1F8;
  --bg-2: #E5E9F3;
  --surface: #FFFFFF;
  --surface-2: #F3F5FB;
  --line: rgba(22, 32, 74, .08);
  --line-2: rgba(22, 32, 74, .17);
  --text: #16204A;
  --muted: #5B668F;
  --gold: #C28A22;
  --inc: #11927F;
  --exp: #CC3A50;
  --lapis: #3553E0;
  --shadow: 0 16px 36px -22px rgba(22, 32, 74, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; }
code { font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
kbd { font: 600 12px var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold); color: var(--gold-ink); }

/* ---------- Yuklanish chizig'i ---------- */
#topbar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200; overflow: hidden; opacity: 0; transition: opacity .2s; }
#topbar.on { opacity: 1; }
#topbar::before { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--gold), var(--inc), transparent); animation: tb 1s var(--ease) infinite; }
@keyframes tb { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Karkas ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 26px 16px 20px;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font: 600 20px var(--disp); letter-spacing: -.01em; padding: 0 10px 22px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--gold) var(--girih) center/34px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); position: relative; }
.brand-mark::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--r-md); color: var(--muted); font-weight: 500; transition: background .2s, color .2s; position: relative; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.side-add { margin-top: 18px; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.side-user { color: var(--muted); }
.side-out { color: var(--exp); font-weight: 500; }

.main { padding: 26px clamp(16px, 3vw, 40px) 120px; width: 100%; max-width: 1320px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.top h1 { font: 600 clamp(22px, 3vw, 28px)/1.15 var(--disp); letter-spacing: -.02em; }
.top-date { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.top-act { display: flex; gap: 8px; align-items: center; }

.view.enter > * { animation: rise .45s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Tugmalar ---------- */
.btn {
  --b: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--b); color: var(--text); font-weight: 600; white-space: nowrap;
  transition: transform .15s var(--ease), filter .2s, background .2s, border-color .2s; position: relative;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: var(--gold-ink); }
.btn.danger { background: var(--exp); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger-ghost { background: transparent; color: var(--exp); border-color: color-mix(in srgb, var(--exp) 40%, transparent); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent; animation: spin .7s linear infinite;
}
.btn.primary.loading::after { border-color: var(--gold-ink) transparent var(--gold-ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 20px; transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; font-size: 15px; }
.icon-btn.muted { color: var(--exp); }

/* ---------- Segment ---------- */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; }
.seg.sm button { padding: 5px 12px; font-size: 13px; }

/* ---------- HERO: balans ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(22px, 3vw, 34px);
  color: #EEF1FA; margin-bottom: 18px;
  background: radial-gradient(120% 140% at 100% 0%, #2A3E9A 0%, transparent 55%), linear-gradient(150deg, #1B2B78 0%, #121D52 55%, #0C1540 100%);
  box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; inset: 0; background: var(--girih) 0 0/64px; opacity: .16;
  -webkit-mask-image: linear-gradient(105deg, transparent 30%, #000 85%); mask-image: linear-gradient(105deg, transparent 30%, #000 85%);
}
.hero > * { position: relative; }
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-label { color: #B8C2EA; font-weight: 500; }
.hero .seg { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); }
.hero .seg button { color: #AEB8E2; }
.hero .seg button.on { background: rgba(255, 255, 255, .14); color: #fff; }
.hero-num { font: 600 clamp(30px, 6.2vw, 58px)/1.1 var(--disp); letter-spacing: -.03em; margin: 16px 0 8px; word-break: break-word; }
.hero-rate { color: #C9D1F2; font-size: 14px; }
.hero-rate span { color: #8E9AD0; margin-left: 6px; }
.hero-flow { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px clamp(20px, 4vw, 48px); margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
.hero-flow small { display: block; color: #9AA6D8; font-size: 13px; margin-bottom: 2px; }
.hero-flow b { font: 600 17px var(--disp); letter-spacing: -.01em; }
.hero .c-inc { color: #52E0CB; }
.hero .c-exp { color: #FF8394; }
.c-inc { color: var(--inc); }
.c-exp { color: var(--exp); }

/* ---------- Hamyonlar ---------- */
.wallets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.wallet {
  --wc: var(--gold); position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--r-lg);
  background: linear-gradient(140deg, color-mix(in srgb, var(--wc) 20%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--wc) 26%, var(--line));
}
.wallet::after { content: ''; position: absolute; right: -28px; bottom: -28px; width: 110px; height: 110px; border-radius: 50%; border: 18px solid color-mix(in srgb, var(--wc) 14%, transparent); }
.w-card::before { content: ''; position: absolute; right: 18px; top: 18px; width: 30px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #E9C878, #B98A2E); opacity: .8; }
.w-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.w-top em { font-style: normal; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--wc); border: 1px solid color-mix(in srgb, var(--wc) 40%, transparent); padding: 0 6px; border-radius: 6px; }
.w-card .w-top em { margin-right: 44px; }
.w-ic { font-size: 18px; }
.w-bal { font: 600 22px/1.2 var(--disp); letter-spacing: -.02em; margin-top: 14px; }
.w-bal.neg { color: var(--exp); }
.wallet small { color: var(--muted); font-size: 13px; }

/* ---------- Statistika ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat-h { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; font-weight: 500; }
.stat-exp { font: 600 19px/1.2 var(--disp); letter-spacing: -.02em; margin: 10px 0 4px; }
.stat-inc { color: var(--inc); font-size: 13px; }
.badge { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.badge.bad { background: color-mix(in srgb, var(--exp) 16%, transparent); color: var(--exp); }
.badge.good { background: color-mix(in srgb, var(--inc) 16%, transparent); color: var(--inc); }

/* ---------- Panellar ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid2.wide-first { grid-template-columns: 1.45fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-h h3 { font-size: 16px; }
.panel-h a { color: var(--gold); font-size: 14px; font-weight: 500; }
.legend-inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.inc { background: var(--inc); } .dot.exp { background: var(--exp); margin-left: 8px; }
.chart-box { position: relative; height: 250px; }
.chart-box.sq { height: 200px; width: 200px; flex: none; }
.pie-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 22px; }
.pie-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.pie-center small { color: var(--muted); font-size: 12px; }
.pie-center b { font: 600 14px var(--disp); letter-spacing: -.02em; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 170px; display: grid; gap: 8px; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend b { color: var(--muted); font-weight: 600; }

/* ---------- Byudjet chiziqlari ---------- */
.bud { padding: 10px 0; }
.bud + .bud { border-top: 1px solid var(--line); }
.bud-h { display: flex; justify-content: space-between; font-weight: 500; }
.bud small { color: var(--muted); font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); margin: 8px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: var(--inc); animation: grow 1s var(--ease) both; }
.bud.warn .bar i { background: var(--gold); }
.bud.over .bar i { background: var(--exp); }
.bud.over .bud-h b { color: var(--exp); }
@keyframes grow { from { width: 0; } }

/* ---------- Amal qatorlari ---------- */
.tx-list { display: flex; flex-direction: column; }
.tx {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border: 0; background: transparent; text-align: left; border-radius: var(--r-md); transition: background .15s;
}
button.tx:hover { background: var(--surface-2); }
.tx-ic { --c: var(--muted); width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; font-size: 19px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-weight: 700; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main b { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tx-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-size: 10px; font-weight: 600; color: var(--lapis); border: 1px solid color-mix(in srgb, var(--lapis) 40%, transparent); padding: 0 5px; border-radius: 5px; }
.tx-amt { font: 600 15px var(--disp); letter-spacing: -.02em; white-space: nowrap; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.tx-amt small { font: 500 12px var(--font); color: var(--muted); }
.tx-amt.income { color: var(--inc); }
.tx-amt.transfer { color: var(--lapis); }
.day-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.day-h:first-child { padding-top: 0; }
.day-h span:last-child { display: flex; gap: 12px; }
.more { display: flex; justify-content: center; margin-top: 10px; }

/* ---------- Skeleton ---------- */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; }
.sk-l { height: 14px; width: 55%; } .sk-s { height: 11px; width: 35%; margin-top: 6px; }
.sk-ic { width: 42px; height: 42px; border-radius: 13px; flex: none; } .sk-a { width: 80px; height: 16px; }
.sk-row { pointer-events: none; }
.sk-hero { min-height: 230px; }
.sk-hero .sk { background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.14) 37%, rgba(255,255,255,.06) 63%); background-size: 400% 100%; }
@keyframes sk { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ---------- Bo'sh holat ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 12px; }
.empty-mark { width: 56px; height: 56px; margin-bottom: 6px; background: var(--girih) center/56px; opacity: .55; border-radius: 16px; border: 1px solid var(--line-2); }
.empty p { margin: 0 0 8px; color: var(--muted); max-width: 36ch; font-size: 14px; }

/* ---------- Toolbar / filtr ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px; height: 42px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; outline: 0; min-width: 0; color: var(--text); }
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mini-field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
input, select { height: 42px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); outline: 0; transition: border-color .2s, box-shadow .2s; min-width: 0; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.filter-row select { max-width: 220px; }
.sumstrip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.sumstrip > div { background: var(--surface); padding: 14px 18px; }
.sumstrip small { display: block; color: var(--muted); font-size: 13px; }
.sumstrip b { font: 600 17px var(--disp); letter-spacing: -.02em; }
.note { color: var(--muted); font-size: 14px; margin: 0 0 16px; max-width: 70ch; }
.note.flat { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- Chip ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { --cc: var(--gold); display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-weight: 500; transition: all .2s var(--ease); }
.chip small { font-size: 12px; opacity: .8; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); border-color: var(--cc); background: color-mix(in srgb, var(--cc) 16%, transparent); }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(5, 9, 28, .6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal-wrap.on { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); transform: translateY(18px) scale(.98); transition: transform .3s var(--ease); }
.modal-wrap.on .modal { transform: none; }
.modal-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; background: var(--surface); }
.modal-h h3 { font: 600 17px var(--disp); letter-spacing: -.01em; }
.modal-h .icon-btn { width: 36px; height: 36px; border: 0; font-size: 24px; }
.modal-b { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-f { display: flex; gap: 8px; align-items: center; padding-top: 6px; }
.modal-f .sp { flex: 1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }

.tx-modal { --tc: var(--exp); }
.tx-modal[data-type=income] { --tc: var(--inc); }
.tx-modal[data-type=transfer] { --tc: var(--lapis); }
.tx-modal .seg button.on { background: color-mix(in srgb, var(--tc) 20%, var(--surface-2)); color: var(--tc); }
.amt-field { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 18px; background: var(--surface-2); border: 1.5px solid color-mix(in srgb, var(--tc, var(--gold)) 35%, transparent); transition: border-color .3s; }
.amt-field:focus-within { border-color: var(--tc, var(--gold)); }
.amt-sign { font: 600 30px var(--disp); color: var(--tc); width: 24px; text-align: center; }
.amt-field input { flex: 1; height: 52px; padding: 0; border: 0; background: transparent; font: 600 clamp(28px, 6vw, 38px) var(--disp); letter-spacing: -.03em; color: var(--text); box-shadow: none !important; width: 100%; }
.amt-field input:focus-visible { outline: none; }
.amt-cur { color: var(--muted); font-weight: 600; white-space: nowrap; }
.sm-amt input { font-size: 26px; height: 44px; }
.amt-sm { display: flex; align-items: center; gap: 8px; }
.amt-sm input { flex: 1; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }

.cat-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cat { --cc: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: transparent; font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: center; line-height: 1.2; transition: all .18s var(--ease); }
.cat span { font-size: 22px; line-height: 1; }
.cat:hover { color: var(--text); border-color: var(--line-2); }
.cat.on { color: var(--text); border-color: var(--cc); background: color-mix(in srgb, var(--cc) 16%, transparent); transform: translateY(-2px); }
.cat.add { border-style: dashed; }
.cat.add span { color: var(--gold); }

/* ---------- Tasdiqlash ---------- */
.cbox-wrap { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(5, 9, 28, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.cbox-wrap.on { opacity: 1; }
.cbox { width: min(400px, 100%); text-align: center; padding: 26px 24px 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); transform: scale(.92); transition: transform .28s var(--ease); }
.cbox-wrap.on .cbox { transform: none; }
.cbox-ic { width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; font-size: 24px; font-weight: 700; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.cbox-ic.danger { background: color-mix(in srgb, var(--exp) 16%, transparent); animation: wob .5s var(--ease); }
.cbox h3 { font: 600 17px var(--disp); letter-spacing: -.01em; }
.cbox p { color: var(--muted); margin: 8px 0 20px; font-size: 14px; }
.cbox-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@keyframes wob { 30% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }

/* ---------- Toast ---------- */
#toasts { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { --tc: var(--inc); pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: tin .4s var(--ease); }
.toast.out { animation: tout .28s ease forwards; }
.t-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 9px; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--tc) 20%, transparent); color: var(--tc); }
.t-msg { flex: 1; font-size: 14px; font-weight: 500; padding-top: 3px; }
.t-x { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 4px; }
.t-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tc); transform-origin: left; animation: tbar linear forwards; }
.t-error { --tc: var(--exp); } .t-warn { --tc: var(--gold); } .t-info, .t-transfer { --tc: var(--lapis); } .t-expense { --tc: var(--exp); }
@keyframes tin { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes tout { to { opacity: 0; transform: translateX(30px); } }
@keyframes tbar { to { transform: scaleX(0); } }

/* ---------- Effektlar ---------- */
.float-amt { position: fixed; left: 50%; top: 45%; z-index: 250; pointer-events: none; font: 700 clamp(28px, 6vw, 44px) var(--disp); letter-spacing: -.03em; transform: translate(-50%, -50%); animation: floatup 1.4s var(--ease) forwards; text-shadow: 0 6px 30px rgba(0,0,0,.35); }
.f-income { color: var(--inc); } .f-expense { color: var(--exp); } .f-transfer { color: var(--lapis); }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 35% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(.95); } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Kategoriyalar sahifasi ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cat-tile { --cc: var(--muted); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; transition: border-color .2s, transform .2s var(--ease); }
.cat-tile:hover { border-color: var(--cc); transform: translateY(-2px); }
.ct-ic { --cc: var(--muted); width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; border-radius: 14px; background: color-mix(in srgb, var(--cc) 20%, transparent); margin-bottom: 6px; flex: none; }
.ct-name { font-weight: 600; }
.cat-tile small { color: var(--muted); font-size: 13px; }
.ct-kw { font-size: 12px; color: var(--muted); opacity: .8; margin-top: 4px; }
.cat-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.cat-preview .ct-ic { margin: 0; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.emoji-grid button { height: 40px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); font-size: 19px; transition: transform .15s; }
.emoji-grid button:hover { transform: scale(1.1); }
.emoji-grid button.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }
.emoji-in { width: 180px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--line-2); transition: transform .15s; }
.swatches button.on { box-shadow: 0 0 0 2px var(--text); transform: scale(1.1); }

/* ---------- Byudjet sahifasi ---------- */
.bud-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.bud-card { display: flex; flex-direction: column; gap: 14px; --rc: var(--inc); }
.bud-card.warn { --rc: var(--gold); } .bud-card.over { --rc: var(--exp); }
.bud-top { display: flex; align-items: center; gap: 12px; }
.bud-top .ct-ic { margin: 0; }
.bud-top div { flex: 1; min-width: 0; }
.bud-top b { display: block; } .bud-top small { color: var(--muted); font-size: 13px; }
.ring { --p: 0; width: 140px; height: 140px; margin: 4px auto; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--rc) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; animation: ringin 1s var(--ease); }
.ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font: 600 24px var(--disp); letter-spacing: -.02em; color: var(--rc); }
@keyframes ringin { from { transform: rotate(-90deg) scale(.8); opacity: 0; } }
.bud-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bud-nums small { display: block; color: var(--muted); font-size: 13px; }
.bud-nums b { font: 600 15px var(--disp); letter-spacing: -.02em; }
.bud-tip { margin: 0; font-size: 13px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Sozlamalar ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.set-grid .set-tg { grid-row: span 2; }
.set-grid .panel { display: flex; flex-direction: column; gap: 14px; }
.set-grid .panel-h { margin-bottom: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--inc) 16%, transparent); color: var(--inc); }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.step-n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); font-weight: 700; font-size: 13px; color: var(--muted); }
.step.done .step-n { background: var(--inc); border-color: var(--inc); color: #04261F; }
.step-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.step-b p { margin: 0; color: var(--muted); font-size: 14px; }
.ok-line { color: var(--inc) !important; font-weight: 500; }
.warn-line { color: var(--gold) !important; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; }
.alert.warn { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold); }
.rate-big { font: 600 24px var(--disp); letter-spacing: -.02em; }
.rate-big b { color: var(--gold); font-weight: 600; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 44px; height: 26px; flex: none; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; transition: background .25s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.switch input:checked + i { background: var(--gold); border-color: var(--gold); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--gold-ink); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.w-row { display: grid; grid-template-columns: auto 1fr 1.2fr auto; gap: 8px; align-items: center; }
.w-row .ct-ic { margin: 0; width: 40px; height: 40px; }
.w-init { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.w-init input { flex: 1; width: 100%; }
.kbd-hint { line-height: 2; }

/* ---------- Kirish sahifasi ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(80% 60% at 50% 0%, #1E2F80 0%, transparent 70%), var(--bg); }
[data-theme=light] body.auth { background: radial-gradient(80% 60% at 50% 0%, #D6DDF6 0%, transparent 70%), var(--bg); }
.auth-card { width: min(420px, 100%); padding: 34px 30px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: rise .5s var(--ease); }
.auth-mark { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 20px; background: var(--gold) var(--girih) center/64px; position: relative; }
.auth-mark::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; background: var(--surface); }
.auth-card h1 { font: 600 26px var(--disp); letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 6px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { margin-top: 6px; height: 48px; }
.auth-err { padding: 12px 14px; margin-bottom: 16px; border-radius: var(--r-md); font-size: 14px; background: color-mix(in srgb, var(--exp) 15%, transparent); color: var(--exp); animation: shake .4s; }

/* ---------- Pastki menyu (mobil) ---------- */
.bnav { display: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid2.wide-first, .set-grid { grid-template-columns: 1fr; }
  .set-grid .set-tg { grid-row: auto; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side, .top-add { display: none; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .bnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 90;
    height: 66px; padding: 0 6px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 0; }
  .bnav a.active { color: var(--gold); }
  .fab { justify-self: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 18px; border: 4px solid var(--bg); background: var(--gold); color: var(--gold-ink); font: 600 30px/1 var(--disp); box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--gold) 70%, transparent); transition: transform .2s var(--ease); }
  .fab:active { transform: scale(.92) rotate(90deg); }
  #toasts { left: 50%; right: auto; transform: translateX(-50%); top: 12px; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
  .modal-h::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
  .wallets { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px 18px; padding: 0 14px; scrollbar-width: none; }
  .wallets::-webkit-scrollbar { display: none; }
  .wallet { flex: 0 0 76%; scroll-snap-align: start; }
  .sumstrip { grid-template-columns: repeat(2, 1fr); }
  .search { max-width: none; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
}
@media (max-width: 560px) {
  .hero-flow { grid-template-columns: 1fr 1fr; }
  .hero-flow > div:last-child { grid-column: span 2; }
  .stat-exp { font-size: 16px; }
  .pie-wrap { flex-direction: column; }
  .chart-box { height: 210px; }
  .row2 { grid-template-columns: 1fr; }
  .w-row { grid-template-columns: auto 1fr; }
  .w-row .w-init, .w-row .w-save { grid-column: span 2; }
  .filter-row select, .filter-row .mini-field { flex: 1 1 45%; max-width: none; }
  .filter-row .mini-field input { flex: 1; }
  .top-act .icon-btn { width: 38px; height: 38px; }
}

/* ---------- Harakatni kamaytirish ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .sk { animation: none; }
}


/* ============================================================
   v2: KO'P FOYDALANUVCHI, AUTH, ADMIN
   ============================================================ */
textarea { font: inherit; color: inherit; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); outline: 0; resize: vertical; min-height: 70px; }
textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.row2.eq { grid-template-columns: 1fr 1fr; }
.alert a { text-decoration: underline; font-weight: 600; }
.view > .alert { margin-bottom: 10px; }
.view > .alert:last-of-type { margin-bottom: 18px; }
.dot.gold { background: var(--gold); margin-left: 8px; }

/* Auth */
.pane.in { animation: rise .35s var(--ease); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; }
.auth-links a, .link-btn { color: var(--muted); background: none; border: 0; padding: 0; font: inherit; font-size: 14px; }
.auth-links a:hover, .link-btn:hover:not(:disabled) { color: var(--text); }
.auth-links .strong { color: var(--gold); font-weight: 600; }
.link-btn:disabled { opacity: .55; cursor: default; }
.link-btn.loading { opacity: .5; }
.phone-in { display: flex; align-items: center; height: 42px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.phone-in:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.phone-in b { padding: 0 4px 0 12px; font-weight: 600; color: var(--muted); }
.phone-in input { flex: 1; border: 0; background: transparent; box-shadow: none !important; padding-left: 4px; letter-spacing: .02em; }
.phone-in input:focus-visible { outline: none; }
.otp-in { height: 64px; text-align: center; font: 600 30px var(--disp); letter-spacing: .45em; padding-left: .45em; }
.auth-card .alert { margin-bottom: 14px; }

/* Profil / tarif */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.plan-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.plan-pill.pro { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.plan-card.pro { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 60%); }
.plan-big { font: 600 20px var(--disp); letter-spacing: -.02em; margin: 0; }
.side-me { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.side-me b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-admin { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 16px !important; }
.brand-tag { font: 600 11px var(--font); font-style: normal; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 6px; padding: 1px 6px; margin-left: -4px; }
.pill.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.pill.bad { background: color-mix(in srgb, var(--exp) 16%, transparent); color: var(--exp); }
.c-gold { color: var(--gold); }

/* Admin: KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi small { color: var(--muted); font-weight: 500; font-size: 14px; }
.kpi b { font: 600 30px/1.15 var(--disp); letter-spacing: -.03em; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.hero-kpi { position: relative; overflow: hidden; color: #EEF1FA; border: 0; background: linear-gradient(150deg, #1B2B78, #0C1540); }
.kpi.hero-kpi::before { content: ''; position: absolute; inset: 0; background: var(--girih) 0 0/48px; opacity: .14; }
.kpi.hero-kpi > * { position: relative; }
.kpi.hero-kpi small, .kpi.hero-kpi span { color: #AEB8E2; }
.split { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.split i { width: var(--w); background: var(--c); transition: width .8s var(--ease); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend .dot { margin: 0; }
.avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 13px; font: 600 14px var(--disp); background: color-mix(in srgb, var(--lapis) 22%, transparent); color: var(--lapis); text-transform: uppercase; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.tx-when { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Admin: foydalanuvchilar jadvali */
.panel.flush { padding: 8px 8px 14px; }
.utable-h, .urow { display: grid; grid-template-columns: minmax(220px, 2.2fr) 1.3fr .9fr .7fr 1.1fr; gap: 12px; align-items: center; }
.utable-h { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.urow { width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: left; border-radius: var(--r-md); transition: background .15s; }
.urow:hover { background: var(--surface-2); }
.urow + .urow { border-top: 1px solid var(--line); }
.u-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.u-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.u-name b { font-weight: 600; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.u-name small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-phone { font-size: 14px; }
.u-tx { font: 600 14px var(--disp); }
.u-seen { color: var(--muted); font-size: 13px; }
.src.tgb { color: var(--inc); border-color: color-mix(in srgb, var(--inc) 40%, transparent); }
.more .muted { margin-right: auto; }
.more { align-items: center; gap: 12px; padding: 0 8px; }

.modal.wide { width: min(720px, 100%); }
.u-head { display: flex; align-items: center; gap: 14px; }
.u-head > div { flex: 1; min-width: 0; }
.u-head h3 { font: 600 18px var(--disp); letter-spacing: -.01em; }
.u-head p { margin: 2px 0 0; }
.u-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.u-actions { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.u-actions .inline-form { flex-wrap: wrap; }

/* Admin: SMS jurnali */
.log { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 120px 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.log-row:first-child { border-top: 0; }
.log-when { color: var(--muted); font-size: 13px; }
.log-msg { min-width: 0; overflow-wrap: anywhere; }
.log-msg small { display: block; font-size: 12px; }

/* Admin: tarif */
.feat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.feat { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.feat > div:first-child { min-width: 0; }
.feat b { display: block; font-weight: 600; }
.feat small { color: var(--muted); font-size: 13px; }
.feat .seg { flex: none; }
.feat .seg button.on[data-t="premium"] { color: var(--gold); }
.feat .seg button.on[data-t="free"] { color: var(--inc); }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; margin-top: 16px; z-index: 5; }
.sticky-save .btn { box-shadow: var(--shadow); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .feat-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .bnav.six { grid-template-columns: repeat(6, 1fr); }
  .bnav.six a span { font-size: 10px; }
  .utable-h { display: none; }
  .urow { grid-template-columns: 1fr auto; grid-template-areas: "name plan" "phone seen"; row-gap: 6px; }
  .urow .u-name { grid-area: name; } .urow > span:nth-child(3) { grid-area: plan; justify-self: end; }
  .urow .u-phone { grid-area: phone; color: var(--muted); font-size: 13px; padding-left: 54px; }
  .urow .u-seen { grid-area: seen; justify-self: end; }
  .urow .u-tx { display: none; }
  .log-row { grid-template-columns: 1fr auto; }
  .log-row .log-msg { grid-column: span 2; }
  .sticky-save { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  .kpi b { font-size: 24px; }
  .u-grid { grid-template-columns: 1fr; }
  .row2.eq { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   TELEGRAM MINI APP
   ============================================================ */
body.mini { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.mini .hero { padding: 20px; margin-bottom: 14px; border-radius: 24px; }
.mini .hero-num { font-size: 34px; margin: 10px 0 6px; }
.mini .hero-flow { margin-top: 16px; padding-top: 14px; grid-template-columns: 1fr 1fr; }
.mini .wallets { display: flex; overflow-x: auto; gap: 10px; margin: 0 -14px 14px; padding: 0 14px; scrollbar-width: none; }
.mini .wallets::-webkit-scrollbar { display: none; }
.mini .wallet { flex: 0 0 auto; min-width: 150px; padding: 14px 16px; }
.mini .w-bal { font-size: 17px; margin-top: 8px; }
.mini-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; --tc: var(--exp); }
.mini-card[data-type=income] { --tc: var(--inc); }
.mini-card[data-type=income] .seg button.on { color: var(--inc); }
.mini-card .seg button.on { color: var(--tc); background: color-mix(in srgb, var(--tc) 18%, var(--surface-2)); }
.mini-card .cat-pick { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.mini-card .cat-pick::-webkit-scrollbar { display: none; }
.mini-card .cat { flex: 0 0 82px; }
.mini h2 { font: 600 15px var(--disp); margin: 4px 0 10px; }
.mini-lock { text-align: center; padding: 60px 20px; }
.mini-lock .auth-mark { margin: 0 auto 18px; }
