/* ==========================================================================
   Savdoon — dizayn tizimi (Apple Human Interface uslubida)
   ========================================================================== */

:root {
  color-scheme: light;
  --blue: #007AFF; --green: #34C759; --red: #FF3B30; --orange: #FF9500; --yellow: #FFCC00;
  --purple: #AF52DE; --indigo: #5856D6; --teal: #30B0C7; --pink: #FF2D55; --mint: #00C7BE; --cyan: #32ADE6; --brown: #A2845E;
  --accent: #0866D9; --brand: #0866D9; --brand-2: #06265B; --brand-hi: #168BEA; --gold: #FFB800;
  --bg: #F2F2F7; --bg-2: #FFFFFF; --bg-3: #F2F2F7; --bg-elev: #FFFFFF;
  --fill: rgba(120,120,128,.20); --fill-2: rgba(120,120,128,.16); --fill-3: rgba(118,118,128,.12); --fill-4: rgba(116,116,128,.08);
  --label: #000000; --label-2: rgba(60,60,67,.60); --label-3: rgba(60,60,67,.30); --label-4: rgba(60,60,67,.18);
  --sep: rgba(60,60,67,.18); --sep-opaque: #C6C6C8;
  --glass: rgba(249,249,251,.72); --glass-strong: rgba(255,255,255,.86); --glass-border: rgba(255,255,255,.5);
  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
  --shadow-2: 0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.05);
  --shadow-3: 0 18px 50px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
  --shadow-pop: 0 24px 80px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.10);
  --r-xs: 8px; --r-sm: 10px; --r: 12px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px; --r-2xl: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI Variable Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sidebar-w: 260px; --topbar-h: 56px; --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2,.8,.2,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue: #0A84FF; --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --yellow: #FFD60A;
    --purple: #BF5AF2; --indigo: #5E5CE6; --teal: #40C8E0; --pink: #FF375F; --mint: #63E6E2; --cyan: #64D2FF;
    --bg: #000000; --bg-2: #1C1C1E; --bg-3: #2C2C2E; --bg-elev: #1C1C1E;
    --fill: rgba(120,120,128,.36); --fill-2: rgba(120,120,128,.32); --fill-3: rgba(118,118,128,.24); --fill-4: rgba(118,118,128,.18);
    --label: #FFFFFF; --label-2: rgba(235,235,245,.60); --label-3: rgba(235,235,245,.30); --label-4: rgba(235,235,245,.16);
    --sep: rgba(84,84,88,.55); --sep-opaque: #38383A;
    --glass: rgba(28,28,30,.72); --glass-strong: rgba(30,30,32,.88); --glass-border: rgba(255,255,255,.08);
    --shadow-2: 0 4px 16px rgba(0,0,0,.4); --shadow-3: 0 18px 50px rgba(0,0,0,.55); --shadow-pop: 0 24px 80px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #0A84FF; --green: #30D158; --red: #FF453A; --orange: #FF9F0A; --yellow: #FFD60A;
  --purple: #BF5AF2; --indigo: #5E5CE6; --teal: #40C8E0; --pink: #FF375F; --mint: #63E6E2; --cyan: #64D2FF;
  --bg: #000000; --bg-2: #1C1C1E; --bg-3: #2C2C2E; --bg-elev: #1C1C1E;
  --fill: rgba(120,120,128,.36); --fill-2: rgba(120,120,128,.32); --fill-3: rgba(118,118,128,.24); --fill-4: rgba(118,118,128,.18);
  --label: #FFFFFF; --label-2: rgba(235,235,245,.60); --label-3: rgba(235,235,245,.30); --label-4: rgba(235,235,245,.16);
  --sep: rgba(84,84,88,.55); --sep-opaque: #38383A;
  --glass: rgba(28,28,30,.72); --glass-strong: rgba(30,30,32,.88); --glass-border: rgba(255,255,255,.08);
  --shadow-2: 0 4px 16px rgba(0,0,0,.4); --shadow-3: 0 18px 50px rgba(0,0,0,.55); --shadow-pop: 0 24px 80px rgba(0,0,0,.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--label); font-family: var(--font);
  font-size: 15px; line-height: 1.4; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
  /* Ilova hissi: matnni tasodifan belgilash, uzoq bosganda brauzer menyusi va ikki marta bosib kattalashtirish yo'q */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
input, textarea, [contenteditable], .selectable, .selectable * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg, a { -webkit-user-drag: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
img { max-width: 100%; display: block; }
svg { flex: none; }
.hidden { display: none !important; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.danger-text { color: var(--red); } .success-text { color: var(--green); } .warn-text { color: var(--orange); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* typography */
.t-large { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.022em; overflow-wrap: anywhere; }
.t-1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; }
.t-2 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.018em; }
.t-3 { font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -.016em; }
.t-head { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.012em; }
.t-body { font-size: 17px; line-height: 22px; }
.t-callout { font-size: 16px; line-height: 21px; }
.t-sub { font-size: 15px; line-height: 20px; }
.t-foot { font-size: 13px; line-height: 18px; }
.t-cap { font-size: 12px; line-height: 16px; }
.t-upper { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; color: var(--label-2); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ========================== Layout ========================== */
#app { min-height: 100vh; min-height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 10px 12px; background: var(--glass); backdrop-filter: saturate(180%) blur(28px); -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-right: .5px solid var(--sep); z-index: 20; overflow: hidden;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #168BEA 0%, #0866D9 50%, #06265B 100%); box-shadow: 0 6px 18px rgba(8,102,217,.35), inset 0 1px 0 rgba(255,255,255,.35); }
.brand-mark svg { width: 26px; height: 26px; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.tenant-switch { margin: 0 4px 8px; padding: 9px 10px; border-radius: var(--r); background: var(--fill-4); display: flex; align-items: center; gap: 10px;
  border: 0; text-align: left; width: calc(100% - 8px); transition: background .2s; }
.tenant-switch:hover { background: var(--fill-3); }
.tenant-switch .ts-name { font-weight: 600; font-size: 14px; }
.tenant-switch .ts-sub { font-size: 12px; color: var(--label-2); }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px 2px 10px; margin: 0 -2px; }
.nav-sec { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--label-3); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 11px; margin: 1px 0; border-radius: 9px;
  color: var(--label); font-size: 14.5px; font-weight: 500; transition: background .15s, color .15s; user-select: none;
}
.nav a .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.06); }
.nav a .ic svg { width: 17px; height: 17px; }
.nav a:hover { background: var(--fill-4); }
.nav a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--label-2); font-weight: 600; }
.nav a .lock { margin-left: auto; color: var(--label-3); width: 14px; height: 14px; }
.sidebar-foot { border-top: .5px solid var(--sep); padding: 10px 4px 0; display: flex; align-items: center; gap: 8px; }
.main { min-width: 0; position: relative; }
.page-host { position: relative; min-height: 100vh; min-height: 100dvh; }
.page { position: relative; min-height: 100vh; min-height: 100dvh; padding: 0 28px 48px; }   /* doimiy will-change yo'q: matn tiniq qoladi */
.page.leaving { position: absolute; inset: 0 0 auto 0; pointer-events: none; z-index: 0; }

.topbar {
  position: sticky; top: 0; z-index: 15; margin: 0 -28px; padding: 10px 28px; min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; background: transparent; transition: background .25s, border-color .25s, backdrop-filter .25s;
  border-bottom: .5px solid transparent;
}
.topbar.scrolled { background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-bottom-color: var(--sep); }
.topbar .tb-title { font-size: 17px; font-weight: 600; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .35s var(--ease); }
.topbar.scrolled .tb-title { opacity: 1; transform: none; }
.topbar .spacer { flex: 1; }
.page-head { display: flex; align-items: flex-end; gap: 16px; padding: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--label-2); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back-btn { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 16px; background: none; border: 0; padding: 6px 6px 6px 0; }
.back-btn svg { width: 22px; height: 22px; }

.tabbar { display: none; }
.mobile-only { display: none !important; }

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .page { padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); }
  .topbar { margin: 0 -16px; padding: calc(8px + var(--safe-t)) 16px 8px; }
  .t-large { font-size: 30px; line-height: 36px; }
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px 4px var(--safe-b); background: var(--glass);
    backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-top: .5px solid var(--sep);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--label-2); font-size: 10.5px; font-weight: 500; }
  .tabbar a svg { width: 25px; height: 25px; }
  .tabbar a.active { color: var(--accent); }
  .page-head .actions { margin-left: 0; width: 100%; }
}

/* ========================== Buttons ========================== */
.btn {
  --b: var(--accent); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 16px; border-radius: 11px; border: 0; background: var(--b); color: #fff; font-weight: 600; font-size: 15px;
  white-space: nowrap; user-select: none; transition: filter .15s, background .2s, opacity .2s, box-shadow .2s; touch-action: manipulation;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { filter: brightness(.95); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.tinted { background: color-mix(in srgb, var(--b) 15%, transparent); color: var(--b); }
.btn.gray { background: var(--fill-3); color: var(--label); }
.btn.plain { background: transparent; color: var(--b); padding: 0 8px; }
.btn.danger { --b: var(--red); } .btn.success { --b: var(--green); } .btn.warn { --b: var(--orange); }
.btn.lg { min-height: 50px; padding: 0 22px; border-radius: 14px; font-size: 17px; }
.btn.xl { min-height: 58px; padding: 0 26px; border-radius: 16px; font-size: 18px; }
.btn.sm { min-height: 30px; padding: 0 11px; border-radius: 9px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 38px; }
.btn.icon.sm { width: 30px; }
.btn.round { border-radius: 999px; }
.btn .spin { width: 18px; height: 18px; }
.btn.loading > :not(.spin) { opacity: 0; }
.btn.loading .spin { position: absolute; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--accent); position: relative; }
.icon-btn:hover { background: var(--fill-4); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

/* press physics — JS skaleni prujina bilan boshqaradi */
.pressable { transform-origin: center; }

/* ========================== Cards & groups ========================== */
.card { background: var(--bg-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; position: relative; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-kpi { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: minmax(0,1fr); } .g-kpi { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }

.group-title { padding: 0 16px 7px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin-top: 22px; }
.group-foot { padding: 7px 16px 0; font-size: 13px; color: var(--label-2); }
.group { background: var(--bg-2); border-radius: var(--r-md); overflow: hidden; }
.cell {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 9px 16px; background: var(--bg-2); width: 100%;
  border: 0; text-align: left; color: var(--label); font-size: 16px;
}
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.cell.ind + .cell.ind::before { left: 58px; }
button.cell:hover, a.cell:hover { background: color-mix(in srgb, var(--bg-2) 92%, var(--label) 8%); }
.cell .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.cell .ci svg { width: 18px; height: 18px; }
.cell .cmain { flex: 1; min-width: 0; }
.cell .ctitle { font-size: 16px; }
.cell .csub { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.cell .cval { color: var(--label-2); font-size: 15px; text-align: right; }
.cell .chev { color: var(--label-3); width: 14px; height: 14px; }
.cell.danger { color: var(--red); }

/* swipe actions */
.swipe { position: relative; overflow: hidden; }
.swipe-actions { position: absolute; inset: 0 0 0 auto; display: flex; }
.swipe-actions button { border: 0; color: #fff; font-weight: 600; padding: 0 18px; min-width: 76px; }
.swipe-body { position: relative; z-index: 1; will-change: transform; }

/* ========================== KPI ========================== */
.kpi { background: var(--bg-2); border-radius: var(--r-lg); padding: 16px 16px 14px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; min-height: 112px; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; color: var(--label-2); font-size: 13px; font-weight: 500; }
.kpi .k-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.kpi .k-ic svg { width: 15px; height: 15px; }
.kpi .k-val { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.kpi .k-val small { font-size: 14px; font-weight: 600; color: var(--label-2); margin-left: 3px; }
.kpi .k-foot { font-size: 12.5px; color: var(--label-2); margin-top: 3px; }
.kpi .k-spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 46px; opacity: .9; }
@media (max-width: 700px) { .kpi { min-height: 96px; padding: 13px; } .kpi .k-val { font-size: 20px; } }

/* ========================== Forms ========================== */
.form { display: grid; gap: 14px; }
.form.cols { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form.cols { grid-template-columns: minmax(0,1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 500; color: var(--label-2); padding-left: 2px; }
.field .hint { font-size: 12px; color: var(--label-2); padding-left: 2px; }
.field .err { font-size: 12.5px; color: var(--red); padding-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid transparent; background: var(--fill-4);
  color: var(--label); font-size: 16px; outline: none; transition: border-color .2s, background .2s, box-shadow .25s;
}
.input::placeholder, .textarea::placeholder { color: var(--label-3); }
.input:focus, .select:focus, .textarea:focus { background: var(--bg-2); border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 12%, transparent); }
.textarea { min-height: 90px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .suffix { position: absolute; right: 13px; color: var(--label-2); font-size: 14px; pointer-events: none; }
.input-wrap .prefix-ic { position: absolute; left: 12px; color: var(--label-3); width: 18px; height: 18px; pointer-events: none; }
.input-wrap .input.has-ic { padding-left: 38px; }
.input.big { font-size: 28px; font-weight: 700; min-height: 60px; letter-spacing: -.02em; text-align: right; font-variant-numeric: tabular-nums; }
.search { position: relative; }
.search .input { padding-left: 38px; background: var(--fill-3); min-height: 38px; border-radius: 11px; font-size: 15.5px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--label-2); pointer-events: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }

/* iOS switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16), 0 3px 1px rgba(0,0,0,.06); will-change: transform; }
.switch input:checked + .track { background: var(--green); }

/* segmented control */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill-3); user-select: none; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 6px 14px; font-size: 13.5px; font-weight: 500; border-radius: 8px; white-space: nowrap; color: var(--label); }
.seg button.on { font-weight: 600; }
.seg .thumb { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 8px; background: var(--bg-elev); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); will-change: transform, width; }
:root[data-theme="dark"] .seg .thumb { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg .thumb { background: #636366; } }
.seg.block { display: grid; width: 100%; }
.seg-scroll { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }

/* chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--fill-3); border: 0; font-size: 14px; font-weight: 500; color: var(--label); white-space: nowrap; transition: background .2s, color .2s; }
.chip.on { background: var(--accent); color: #fff; }
.chip svg { width: 15px; height: 15px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: color-mix(in srgb, var(--c, var(--label-2)) 14%, transparent); color: var(--c, var(--label-2)); white-space: nowrap; }
.badge.green { --c: var(--green); } .badge.red { --c: var(--red); } .badge.orange { --c: var(--orange); } .badge.blue { --c: var(--blue); }
.badge.purple { --c: var(--purple); } .badge.gray { --c: var(--label-2); } .badge.teal { --c: var(--teal); }
.dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--green)); display: inline-block; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; flex: none;
  background: linear-gradient(145deg, var(--a1, #8E8E93), var(--a2, #636366)); }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }

/* ========================== Tables ========================== */
.tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); background: var(--bg-2); box-shadow: var(--shadow-1); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--label-2); padding: 11px 14px; border-bottom: .5px solid var(--sep); white-space: nowrap; position: sticky; top: 0; background: var(--bg-2); }
.tbl td { padding: 11px 14px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--fill-4); }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: .5px solid var(--sep); }
@media (max-width: 700px) {
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; padding: 10px 14px; border-bottom: .5px solid var(--sep); }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; }
  .tbl.cards td::before { content: attr(data-l); color: var(--label-2); font-size: 13px; }
  .tbl.cards td.r { text-align: right; }
}

/* ========================== Sheets / modals ========================== */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.32); will-change: opacity; }
.sheet {
  position: fixed; z-index: 101; left: 50%; top: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 900px);
  display: flex; flex-direction: column; background: var(--bg); border-radius: var(--r-2xl); box-shadow: var(--shadow-pop);
  overflow: hidden; translate: -50% -50%;   /* doimiy will-change yo'q — matn tiniq */
}
.sheet.wide { width: min(860px, calc(100vw - 32px)); }
.sheet.xwide { width: min(1100px, calc(100vw - 32px)); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; position: relative; flex: none; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; flex: 1; }
.sheet-head .btn.plain { font-weight: 500; }
.sheet-head .btn.plain.strong { font-weight: 700; }
.sheet-grab { display: none; }
.sheet-body { overflow-y: auto; padding: 4px 18px 20px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 18px calc(14px + var(--safe-b)); border-top: .5px solid var(--sep); display: flex; gap: 10px; flex: none; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
@media (max-width: 700px) {
  .sheet, .sheet.wide, .sheet.xwide { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: calc(100dvh - 44px - var(--safe-t)); translate: none;
    border-radius: 14px 14px 0 0; }
  .sheet-grab { display: block; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill); }
  .sheet-head { padding-top: 18px; }
}

/* dialog (alert) */
.dialog { position: fixed; z-index: 120; left: 50%; top: 50%; width: 290px; translate: -50% -50%; border-radius: 16px; overflow: hidden;
  background: var(--glass-strong); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-pop); text-align: center; }
.dialog .d-body { padding: 20px 18px 16px; }
.dialog h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.dialog p { margin: 0; font-size: 13.5px; color: var(--label); opacity: .85; }
.dialog .d-input { margin-top: 12px; }
.dialog .d-input .input { min-height: 36px; font-size: 14px; background: var(--bg-2); }
.dialog .d-acts { display: flex; border-top: .5px solid var(--sep); }
.dialog .d-acts button { flex: 1; border: 0; background: transparent; min-height: 46px; font-size: 17px; color: var(--accent); }
.dialog .d-acts button + button { border-left: .5px solid var(--sep); }
.dialog .d-acts button.bold { font-weight: 600; }
.dialog .d-acts button.red { color: var(--red); }
.dialog .d-acts button:active { background: var(--fill-4); }

/* action sheet / context menu */
.menu { position: fixed; z-index: 130; min-width: 230px; border-radius: 14px; overflow: hidden; background: var(--glass-strong);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-pop); transform-origin: top left; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; border: 0; background: transparent; font-size: 16px; text-align: left; color: var(--label); }
.menu button + button { border-top: .5px solid var(--sep); }
.menu button:hover { background: var(--fill-4); }
.menu button svg { width: 19px; height: 19px; margin-left: auto; color: var(--label-2); }
.menu button.red, .menu button.red svg { color: var(--red); }

/* toast — Dynamic Island uslubida */
.island { position: fixed; z-index: 200; top: calc(12px + var(--safe-t)); left: 50%; translate: -50% 0; min-height: 44px; max-width: min(440px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 28px; background: #0B0B0C; color: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); font-size: 14.5px; font-weight: 500; will-change: transform, opacity; pointer-events: auto; overflow: hidden; }
.island .is-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.island .is-ic svg { width: 16px; height: 16px; }
.island .is-text { min-width: 0; }
.island .is-text b { display: block; font-weight: 600; }
.island .is-text span { color: rgba(255,255,255,.7); font-size: 13px; }

/* skeleton / loader */
.skel { position: relative; overflow: hidden; background: var(--fill-4); border-radius: 8px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg-2) 70%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 22px; height: 22px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-page { display: grid; place-items: center; min-height: 60vh; }

/* empty state */
.empty { text-align: center; padding: 48px 20px; color: var(--label-2); }
.empty .e-ic { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.empty .e-ic svg { width: 36px; height: 36px; }
.empty h3 { color: var(--label); margin: 0 0 4px; font-size: 19px; }
.empty p { margin: 0 auto 16px; max-width: 360px; }

/* banner */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--c, var(--orange)) 13%, var(--bg-2));
  color: var(--label); margin-bottom: 16px; border: .5px solid color-mix(in srgb, var(--c, var(--orange)) 30%, transparent); }
.banner svg { color: var(--c, var(--orange)); width: 22px; height: 22px; flex: none; }
.banner .sp { flex: 1; }

/* progress */
.progress { height: 6px; border-radius: 3px; background: var(--fill-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--accent)); transform-origin: left; }

/* ========================== Charts ========================== */
.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--sep); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ax { fill: var(--label-2); font-size: 11px; font-family: var(--font); }
.chart .tip-line { stroke: var(--label-3); stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 11px; border-radius: 11px; background: var(--glass-strong);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-3); font-size: 12.5px; white-space: nowrap; }
.chart-tip b { display: block; font-size: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--label-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-wrap svg { width: 150px; height: 150px; flex: none; }
.bars-h .bh { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 6px 0; }
.bars-h .bh .bar { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--fill-4); overflow: hidden; }
.bars-h .bh .bar i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--accent)); transform-origin: left; }

/* ========================== POS ========================== */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 0; height: 100vh; height: 100dvh; margin: 0 -28px; }
.pos-left { display: flex; flex-direction: column; min-width: 0; padding: 14px 18px 0 28px; }
.pos-top { display: flex; gap: 10px; align-items: center; }
.pos-top .search { flex: 1; }
.pos-top .search .input { min-height: 46px; font-size: 17px; border-radius: 14px; }
.pos-cats { margin: 12px 0 10px; }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; padding: 2px 2px 20px; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; min-height: 118px; border-radius: 16px; background: var(--bg-2); border: 0; text-align: left;
  box-shadow: var(--shadow-1); color: var(--label); user-select: none; overflow: hidden; }
.pcard .p-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(145deg, var(--a1), var(--a2)); }
.pcard .p-name { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .p-price { margin-top: auto; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pcard .p-stock { position: absolute; top: 10px; right: 10px; font-size: 11.5px; color: var(--label-2); font-weight: 600; }
.pcard .p-stock.low { color: var(--orange); } .pcard .p-stock.out { color: var(--red); }
.pcard .p-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .14; }
.pos-right { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-left: .5px solid var(--sep); }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: .5px solid var(--sep); }
.cart-cust { flex: 1; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--fill-4); border: 0; text-align: left; min-width: 0; }
.cart-list { flex: 1; overflow-y: auto; }
.cart-item { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; padding: 11px 16px; border-bottom: .5px solid var(--sep); background: var(--bg-2); }
.cart-item.sel { background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
.cart-item .ci-name { font-weight: 600; font-size: 14.5px; }
.cart-item .ci-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.cart-item .ci-sub { font-size: 12.5px; color: var(--label-2); }
.qty-ctl { display: inline-flex; align-items: center; gap: 2px; background: var(--fill-4); border-radius: 10px; padding: 2px; }
.qty-ctl button { width: 30px; height: 28px; border: 0; background: transparent; border-radius: 8px; color: var(--accent); display: grid; place-items: center; }
.qty-ctl button:hover { background: var(--fill-3); }
.qty-ctl button svg { width: 16px; height: 16px; }
.qty-ctl input { width: 52px; text-align: center; border: 0; background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; font-size: 15px; }
.cart-sum { padding: 12px 16px; border-top: .5px solid var(--sep); display: grid; gap: 4px; }
.cart-sum .ln { display: flex; justify-content: space-between; color: var(--label-2); font-size: 14px; }
.cart-sum .ln b { color: var(--label); font-variant-numeric: tabular-nums; }
.cart-sum .tot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.cart-sum .tot span { font-size: 15px; font-weight: 600; }
.cart-sum .tot { gap: 10px; }
.cart-sum .tot span { flex: none; }
.cart-sum .tot b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; min-width: 0; flex: 1; text-align: right; }
.cart-acts { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; padding: 0 16px calc(14px + var(--safe-b)); }
.shift-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--fill-4); font-size: 13px; font-weight: 600; border: 0; color: var(--label); white-space: nowrap; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 0;
  background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--fill-3); font-size: 11px; font-weight: 600; color: var(--label-2); font-family: var(--mono); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.pay-m { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 13px; border-radius: 16px; border: 2px solid transparent; background: var(--bg-2);
  box-shadow: var(--shadow-1); text-align: left; color: var(--label); }
.pay-m .pm-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.pay-m .pm-ic svg { width: 18px; height: 18px; }
.pay-m .pm-amt { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; min-height: 18px; }
.pay-m.on { border-color: var(--accent); }
.pay-m.on .pm-amt { color: var(--accent); font-weight: 700; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 52px; border-radius: 14px; border: 0; background: var(--bg-2); font-size: 22px; font-weight: 500; box-shadow: var(--shadow-1); color: var(--label); }
.keypad button:active { background: var(--fill-3); }
.quick-cash { display: flex; gap: 8px; flex-wrap: wrap; }
.change-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--green) 12%, var(--bg-2)); }
.change-box b { font-size: 24px; color: var(--green); font-variant-numeric: tabular-nums; }
.success-anim { display: grid; place-items: center; padding: 18px 0 6px; }
.success-anim svg { width: 92px; height: 92px; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0,1fr) 360px; } }
@media (max-width: 900px) {
  .pos { display: block; height: auto; margin: 0 -16px; }
  .pos-left { padding: 10px 16px 0; min-height: calc(100dvh - var(--tabbar-h)); }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding-bottom: 150px; }
  .pos-right { display: none; }
  .pos-fab { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 30; display: flex; align-items: center; gap: 12px;
    padding: 12px 14px 12px 18px; border-radius: 18px; background: var(--accent); color: #fff; border: 0; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
  .pos-fab b { font-size: 19px; margin-left: auto; font-variant-numeric: tabular-nums; }
}
.pos-fab { display: none; }
@media (max-width: 900px) { .pos-fab { display: flex; } }

/* ========================== Login ========================== */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); position: relative; overflow: hidden; }
.auth-hero { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: #0b1020; isolation: isolate; }
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .85; z-index: -1; will-change: transform; }
.auth-hero h1 { font-size: 52px; line-height: 1.04; letter-spacing: -.035em; margin: 0; font-weight: 800; }
.auth-hero p { font-size: 19px; line-height: 1.45; color: rgba(255,255,255,.78); max-width: 520px; margin: 18px 0 0; }
.hero-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin-top: 34px; }
.hero-feat { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.08); border: .5px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 14.5px; font-weight: 500; }
.hero-feat svg { width: 20px; height: 20px; color: #9ecbff; }
.auth-card-wrap { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 30px; letter-spacing: -.025em; margin: 0 0 6px; }
.qr-box { position: relative; width: 236px; height: 236px; margin: 22px auto 16px; border-radius: 26px; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow-3); }
.qr-box > canvas, .qr-box > img, .qr-box > svg { width: 196px; height: 196px; image-rendering: pixelated; }
.qr-box .qr-logo svg { width: 32px; height: 32px; }   /* markazdagi logotip QR o'lchamini olmasin */
.qr-box .qr-logo { position: absolute; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 5px #fff; }
.qr-box .qr-logo .brand-mark { width: 46px; height: 46px; border-radius: 13px; }
.qr-box .qr-done { position: absolute; inset: 0; border-radius: 26px; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 92%, transparent); color: #fff; opacity: 0; }
.qr-box .qr-done svg { width: 90px; height: 90px; }
.steps { display: grid; gap: 10px; margin: 6px 0 22px; counter-reset: st; }
.steps div { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--label-2); }
.steps div::before { counter-increment: st; content: counter(st); width: 24px; height: 24px; border-radius: 50%; background: var(--fill-3); color: var(--label); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--label-3); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: .5px; background: var(--sep); }
.tg-btn { --b: #2AABEE; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: calc(30px + var(--safe-t)) 22px 30px; min-height: auto; }
  .auth-hero h1 { font-size: 34px; }
  .auth-hero p { font-size: 16px; }
  .hero-feats { display: none; }
}

/* onboarding steps */
.ob-steps { display: flex; gap: 6px; margin: 4px 0 22px; }
.ob-steps i { height: 4px; flex: 1; border-radius: 2px; background: var(--fill-3); overflow: hidden; position: relative; }
.ob-steps i b { position: absolute; inset: 0; background: var(--accent); transform-origin: left; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 22px; background: var(--bg-2); box-shadow: var(--shadow-1); border: 2px solid transparent; }
.plan.cur { border-color: var(--accent); }
.plan.pop::before { content: "Ommabop"; position: absolute; top: -11px; left: 20px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.plan h3 { margin: 0; font-size: 20px; }
.plan .pr { font-size: 28px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.plan .pr small { font-size: 14px; color: var(--label-2); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 7px; font-size: 14px; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { width: 16px; height: 16px; color: var(--green); margin-top: 2px; }

/* notifications panel */
.notif { display: flex; gap: 12px; padding: 12px 4px; border-bottom: .5px solid var(--sep); }
.notif.unread .n-title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 1px; }
.notif .n-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.notif .n-ic svg { width: 18px; height: 18px; }
.notif .n-title { font-weight: 600; font-size: 15px; }
.notif .n-body { color: var(--label-2); font-size: 14px; white-space: pre-line; }
.notif .n-time { color: var(--label-3); font-size: 12px; margin-top: 2px; }

/* misc */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14.5px; }
.kv dt { color: var(--label-2); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.divider { height: .5px; background: var(--sep); margin: 12px 0; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-amt { color: var(--green); } .neg-amt { color: var(--red); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.barcode-list { display: flex; gap: 6px; flex-wrap: wrap; }
.barcode-list .chip { font-family: var(--mono); font-size: 13px; }
.drop { border: 2px dashed var(--fill); border-radius: 18px; padding: 28px; text-align: center; color: var(--label-2); transition: border-color .2s, background .2s; cursor: pointer; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--fill-3); border-radius: 1px; }
.tl-item { position: relative; padding: 6px 0 10px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 0 3px var(--bg-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ptr { position: absolute; left: 0; right: 0; top: 0; display: grid; place-items: center; height: 0; overflow: visible; z-index: 5; pointer-events: none; }
.ptr svg { width: 26px; height: 26px; color: var(--label-2); }
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, 58mm); gap: 4mm; }
.lbl { width: 58mm; height: 40mm; border: 1px dashed var(--fill); border-radius: 6px; padding: 2.5mm; display: flex; flex-direction: column; justify-content: space-between; background: #fff; color: #000; }
.lbl .ln { font-size: 10pt; font-weight: 600; line-height: 1.15; max-height: 2.4em; overflow: hidden; }
.lbl .lp { font-size: 15pt; font-weight: 800; }
.lbl svg { width: 100%; height: 14mm; }
.admin-badge { background: linear-gradient(135deg, #FF9500, #FF2D55); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.support-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--orange); color: #fff; font-weight: 600; font-size: 14px; }

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

/* ========================== Print ========================== */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .tabbar, .topbar, .no-print, .page-head .actions { display: none !important; }
  .shell { display: block; } .page { padding: 0; }
  .card, .tbl-wrap { box-shadow: none; border: 1px solid #ddd; }
  .lbl { border: 0; page-break-inside: avoid; }
}

html.in-telegram .topbar{padding-top:0}
/* Til tugmasi — ilovadagidek (brauzer <select> ramkasi emas) */
.lang-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 14px; border: 0; border-radius: 14px;
  background: var(--fill-3); color: var(--label); font-size: 15px; font-weight: 600; text-align: left; transition: background .15s, transform .15s; }
.lang-btn:active { transform: scale(.97); background: var(--fill-2); }
.lang-btn span { flex: 1; }
.lang-btn .chev { width: 12px; height: 8px; color: var(--label-3); flex: none; }
.flag { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lp-head h2 { margin: 0; }
.lang-compact { width: auto; min-height: 34px; padding: 5px 10px 5px 6px; gap: 6px; border-radius: 999px; font-size: 13px; }
.lang-compact .flag { width: 22px; height: 22px; }
.lang-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; }
.lang-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 10px 14px; border: 0; border-radius: 14px; background: none;
  font-size: 16px; font-weight: 500; text-align: left; color: var(--label); }
.lang-row:active { background: var(--fill-3); }
.lang-row span { flex: 1; }
.lang-row .flag { width: 30px; height: 30px; }
.lang-row.on { font-weight: 700; color: var(--accent); }
.lang-row .ok { width: 22px; height: 22px; color: var(--accent); }
html.lang-switching body { opacity: 0; transition: opacity .18s; }

/* ---- Brend: qorong'i rejimda aksent ---- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent: #3D8EF0; } }
:root[data-theme="dark"] { --accent: #3D8EF0; }
/* ---- Logotip animatsiyasi: yorliq "chiqadi", tanga aylanadi, S-strelkalar chiziladi ---- */
.logo-anim .lg-tag { transform-origin: 256px 256px; transform: scale(.3) rotate(-25deg); opacity: 0; animation: lgTag .8s cubic-bezier(.2,1.45,.3,1) forwards; }
.logo-anim .lg-coin { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: lgCoin .6s .45s cubic-bezier(.2,1.7,.3,1) forwards; }
.logo-anim .lg-s1, .logo-anim .lg-s2 { stroke-dasharray: 160; stroke-dashoffset: 160; animation: lgDraw .55s cubic-bezier(.65,0,.35,1) forwards; }
.logo-anim .lg-s1 { animation-delay: .6s; } .logo-anim .lg-s2 { animation-delay: .85s; }
.logo-anim .lg-h1, .logo-anim .lg-h2 { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: lgCoin .4s forwards; }
.logo-anim .lg-h2 { animation-delay: 1.3s; } .logo-anim .lg-h1 { animation-delay: 1.05s; }
@keyframes lgDraw { to { stroke-dashoffset: 0; } }
@keyframes lgTag { 50% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes lgCoin { to { transform: none; } }
.logo-shine { position: relative; overflow: hidden; }
.logo-shine::after { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  transform: translateX(-120%); animation: lgShine 1.1s 1.35s ease-in-out forwards; }
@keyframes lgShine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .logo-anim * , .logo-shine::after { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; transform: none !important; } }

/* Jadval → Excel */
.xl-bar{justify-content:flex-end;padding:6px 8px 0}
@media (min-width:1001px){.xl-bar.desktop-only{display:flex!important}}
.xl-btn{display:inline-flex;align-items:center;gap:5px;border:0;background:var(--fill-3);color:var(--accent);font:600 12.5px/1 var(--font);padding:6px 10px;border-radius:8px;cursor:pointer}
.xl-btn svg{width:14px;height:14px}.xl-btn:hover{background:color-mix(in srgb,var(--accent) 14%,transparent)}
