/* Kontrum — dizayn tizimi. Oq, toza, bitta asosiy rang. Raqamlar bir xil kenglikda. */
:root {
  --ac: #2453b8; --ac-h: #1c4396; --ac-soft: #edf2fc; --ac-ring: rgba(36, 83, 184, .18); --pr: #1d2125; --pr-h: #000000; --pr-tx: #ffffff;
  --bg: #f5f6f7; --sf: #ffffff; --sf2: #fafafa; --sf3: #f2f4f5;
  --bd: #e3e6e8; --bd2: #d3d8db; --tx: #15191c; --tx2: #4f5a62; --tx3: #808b93;
  --red: #c0362c; --red-soft: #fdeeec; --green: #127a46; --green-soft: #e8f5ee; --amber: #a35b00; --amber-soft: #fdf3e3; --blue: #2457a6; --blue-soft: #eaf1fb;
  --r: 8px; --r-sm: 6px; --sh: 0 1px 2px rgba(16, 24, 32, .05); --sh-lg: 0 12px 32px rgba(16, 24, 32, .16), 0 2px 6px rgba(16, 24, 32, .06);
  --fs: 14px; --side: 228px; --top: 52px;
  font-size: var(--fs);
}
[data-theme="dark"] {
  --ac: #7ea2ef; --ac-h: #9db8f3; --ac-soft: #1c2638; --ac-ring: rgba(126, 162, 239, .25); --pr: #e6e9eb; --pr-h: #ffffff; --pr-tx: #121517;
  --bg: #121517; --sf: #1a1e21; --sf2: #1e2326; --sf3: #252a2e; --bd: #2c3236; --bd2: #3a4146;
  --tx: #e8ecee; --tx2: #b0bac0; --tx3: #7f8a91; --red: #ef6b5f; --red-soft: #3a1f1c; --green: #4cc185; --green-soft: #183026; --amber: #e5a046; --amber-soft: #36291a; --blue: #6c9be0; --blue-soft: #1b2738;
  --sh: none; --sh-lg: 0 12px 32px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 1rem; line-height: 1.45; color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ac); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { width: 18px; height: 18px; flex: none; }
.num, td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; }
.muted { color: var(--tx3); } .sm { font-size: .88em; } .xs { font-size: .8em; }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
.b { font-weight: 600; } .nowrap { white-space: nowrap; } .hide { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }

/* ===== Kirish ekrani ===== */
.loading { display: grid; place-items: center; height: 100vh; color: var(--tx3); letter-spacing: .02em; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 460px) 1fr; }
.auth-form { background: var(--sf); padding: 48px 48px 32px; display: flex; flex-direction: column; border-right: 1px solid var(--bd); }
.auth-form h1 { font-size: 22px; margin: 36px 0 6px; font-weight: 600; }
.auth-form p.lead { color: var(--tx2); margin: 0 0 24px; }
.auth-side { padding: 64px; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 640px; }
.auth-side h2 { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.auth-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.auth-side li { display: flex; gap: 12px; color: var(--tx2); } .auth-side li b { color: var(--tx); font-weight: 600; display: block; }
.auth-side li .ic { color: var(--ac); margin-top: 2px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--pr); color: var(--pr-tx) !important; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.auth-foot { margin-top: auto; padding-top: 24px; color: var(--tx3); font-size: 12.5px; display: flex; gap: 12px; align-items: center; }

/* ===== Asosiy tuzilma ===== */
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; }
.side { background: var(--sf); border-right: 1px solid var(--bd); display: flex; flex-direction: column; min-height: 0; }
.side-top { height: var(--top); padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid var(--bd); }
.side-firm { font-size: 12px; color: var(--tx3); font-weight: 400; margin-top: 1px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.side-act { padding: 8px 2px 2px; }
.side-act .btn { width: 100%; justify-content: flex-start; height: 36px; background: var(--sf3); border-color: var(--bd); color: var(--tx); box-shadow: none; font-weight: 600; }
.side-act .btn:hover { background: var(--bd); border-color: var(--bd2); }
.side-act .btn kbd { border-color: var(--bd2); color: var(--tx3); background: var(--sf); }
.side-act .btn span { flex: 1; text-align: left; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx3); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--tx2); font-weight: 500; text-decoration: none; margin: 1px 0; }
.nav a:hover { background: var(--sf3); color: var(--tx); }
.nav a.on { background: var(--ac-soft); color: var(--ac); }
.nav a .cnt { margin-left: auto; font-size: 11.5px; background: var(--sf3); color: var(--tx2); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.nav a.on .cnt { background: var(--sf); }
.side-bot { border-top: 1px solid var(--bd); padding: 8px; flex: none !important; overflow: visible !important; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top); background: var(--sf); border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 12px; padding: 0 20px; flex: none; }
.gsearch { position: relative; width: 380px; max-width: 40vw; }
.gsearch input { width: 100%; padding-left: 34px; background: var(--sf3); border-color: transparent; }
.gsearch input:focus { background: var(--sf); }
.gsearch .ic { position: absolute; left: 10px; top: 8px; color: var(--tx3); }
.gsearch kbd { position: absolute; right: 8px; top: 7px; }
kbd { font-family: inherit; font-size: 11px; border: 1px solid var(--bd2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--tx2); background: var(--sf); }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx2); padding: 4px 10px; border-radius: 20px; background: var(--sf3); cursor: pointer; border: 0; }
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tx3); }
.sync.ok .dot { background: var(--green); } .sync.syncing .dot { background: var(--amber); } .sync.offline .dot, .sync.error .dot, .sync.auth .dot { background: var(--red); }
.content { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 20px 24px 40px; max-width: 1600px; }
.page.full { max-width: none; }
.phead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 36px; }
.phead h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.phead .sub { color: var(--tx3); font-size: 13px; }
.crumb { display: flex; align-items: center; gap: 4px; color: var(--tx3); font-size: 13px; margin-bottom: 4px; }
.crumb a { color: var(--tx3); }

/* ===== Tablar ===== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--bd); margin: 0 0 16px; }
.tabs a, .tabs button { padding: 9px 14px; color: var(--tx2); font-weight: 500; border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; text-decoration: none; display: flex; gap: 6px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--tx); }
.tabs .on { color: var(--ac); border-bottom-color: var(--ac); }
.tabs .cnt { font-size: 11.5px; background: var(--sf3); border-radius: 10px; padding: 0 6px; color: var(--tx2); }

/* ===== Tugmalar va maydonlar ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--bd2); background: var(--sf); color: var(--tx); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; box-shadow: var(--sh); }
.btn:hover { background: var(--sf3); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ac-ring); }
.btn.primary { background: var(--pr); border-color: var(--pr); color: var(--pr-tx); }
.btn.primary:hover { background: var(--pr-h); border-color: var(--pr-h); }
.btn.danger { color: var(--red); } .btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--tx2); }
.btn.ghost:hover { background: var(--sf3); color: var(--tx); }
.btn.sm { height: 28px; padding: 0 9px; font-size: .92em; } .btn.lg { height: 42px; padding: 0 18px; font-size: 1.05em; }
.btn.icon { width: 34px; padding: 0; } .btn.sm.icon { width: 28px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn kbd { border-color: rgba(255, 255, 255, .35); background: transparent; color: inherit; opacity: .8; }
input, select, textarea { height: 34px; border: 1px solid var(--bd2); border-radius: var(--r-sm); padding: 0 10px; background: var(--sf); outline: none; min-width: 0; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-ring); }
input.err, select.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192, 54, 44, .12); }
input[type=checkbox], input[type=radio] { height: 16px; width: 16px; accent-color: var(--ac); margin: 0; }
input.n { text-align: right; font-variant-numeric: tabular-nums; }
label.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--tx2); font-weight: 500; }
.field > small { color: var(--tx3); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.grid { display: grid; gap: 12px 14px; }
.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)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--bd2); border-radius: var(--r-sm); overflow: hidden; background: var(--sf); }
.seg button { border: 0; background: none; padding: 0 11px; height: 32px; cursor: pointer; color: var(--tx2); border-right: 1px solid var(--bd); white-space: nowrap; }
.seg button:last-child { border-right: 0; } .seg button:hover { background: var(--sf3); } .seg button.on { background: var(--ac-soft); color: var(--ac); font-weight: 600; }

/* ===== Asboblar qatori ===== */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search { position: relative; width: 280px; }
.toolbar .search input { width: 100%; padding-left: 32px; }
.toolbar .search .ic { position: absolute; left: 9px; top: 8px; color: var(--tx3); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--ac-soft); color: var(--ac); font-size: 12.5px; font-weight: 500; border: 0; cursor: pointer; }

/* ===== Jadval ===== */
.card { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sh); }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--bd); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.card-b { padding: 16px; }
.tblwrap { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 210px); box-shadow: var(--sh); }
.tblwrap.free { max-height: none; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .965em; }
.tbl th { position: sticky; top: 0; background: var(--sf2); z-index: 2; text-align: left; font-weight: 600; color: var(--tx2); font-size: 12.5px; padding: 0 10px; height: 36px; border-bottom: 1px solid var(--bd); white-space: nowrap; user-select: none; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: var(--tx); }
.tbl th .arr { color: var(--ac); margin-left: 3px; }
.tbl td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--bd); vertical-align: middle; }
.tbl tbody tr { cursor: default; } .tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--sf2); }
.tbl tbody tr.sel td { background: var(--ac-soft); }
.tbl tbody tr.dim td { color: var(--tx3); }
.tbl tfoot td { position: sticky; bottom: 0; background: var(--sf2); font-weight: 600; border-top: 1px solid var(--bd); border-bottom: 0; z-index: 2; }
.tbl td.chk, .tbl th.chk { width: 36px; padding: 0 0 0 12px; }
.tbl td.act { width: 1%; white-space: nowrap; text-align: right; }
.tbl .ttl { font-weight: 500; color: var(--tx); }
.tbl td .sub { display: block; font-size: 12px; color: var(--tx3); line-height: 1.2; }
.empty { padding: 48px 16px; text-align: center; color: var(--tx3); }
.empty b { display: block; color: var(--tx2); font-size: 15px; margin-bottom: 6px; font-weight: 600; }
.empty .row { justify-content: center; margin-top: 14px; }
.colmenu { position: absolute; }
.bulk { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--ac-soft); border-radius: var(--r); margin-bottom: 10px; color: var(--ac); font-weight: 500; }

/* ===== Belgilar ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--sf3); color: var(--tx2); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.green { background: var(--green-soft); color: var(--green); } .badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.blue { background: var(--blue-soft); color: var(--blue); } .badge.ac { background: var(--ac-soft); color: var(--ac); }
.dotc { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ===== Bosh sahifa ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); }
.kpi .l { color: var(--tx2); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .d { font-size: 12px; color: var(--tx3); margin-top: 2px; }
.kpi.link { cursor: pointer; } .kpi.link:hover { border-color: var(--bd2); }
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.list-rows { display: flex; flex-direction: column; }
.list-rows > div { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--bd); }
.list-rows > div:last-child { border-bottom: 0; }
.list-rows > div.click { cursor: pointer; } .list-rows > div.click:hover { background: var(--sf2); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding: 12px 16px 6px; }
.bars .bar { flex: 1; background: var(--ac); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .bar:hover { opacity: 1; }
.bars-x { display: flex; gap: 4px; padding: 0 16px 10px; font-size: 10.5px; color: var(--tx3); }
.bars-x span { flex: 1; text-align: center; overflow: hidden; }
.hbar { height: 6px; background: var(--sf3); border-radius: 3px; overflow: hidden; } .hbar i { display: block; height: 100%; background: var(--ac); }

/* ===== Hujjat muharriri ===== */
.doc { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.doc-head { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.doc-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.totals { background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); padding: 6px 16px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--bd); gap: 10px; }
.totals > div:last-child { border-bottom: 0; }
.totals .big { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals input { width: 110px; height: 30px; }
.lines td { height: 40px; }
.lines td input, .lines td select { height: 30px; width: 100%; border-color: transparent; background: transparent; box-shadow: none; padding: 0 6px; }
.lines td input:hover { border-color: var(--bd); }
.lines td input:focus { border-color: var(--ac); background: var(--sf); box-shadow: 0 0 0 3px var(--ac-ring); }
.lines tr.bad td { background: var(--red-soft) !important; }
.lines tr.warn td { background: var(--amber-soft) !important; }
.lines .hint { font-size: 11.5px; color: var(--tx3); line-height: 1.1; padding: 0 6px; display: block; }
.lines .hint.red { color: var(--red); }
.addline { padding: 8px 10px; border-top: 1px solid var(--bd); }
.party-info { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx2); margin-top: 8px; }
.party-info b { color: var(--tx); font-weight: 600; }

/* ===== Tanlash ro'yxati (combobox) ===== */
.cbx { position: relative; }
.cbx-list { position: fixed; z-index: 1000; background: var(--sf); border: 1px solid var(--bd2); border-radius: var(--r); box-shadow: var(--sh-lg); max-height: 340px; overflow-y: auto; min-width: 320px; padding: 4px; }
.cbx-item { padding: 7px 10px; border-radius: 5px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.cbx-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-item small { color: var(--tx3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cbx-item.on { background: var(--ac-soft); }
.cbx-item.new { color: var(--ac); font-weight: 500; border-top: 1px solid var(--bd); border-radius: 0 0 5px 5px; margin-top: 2px; }
.cbx-empty { padding: 10px; color: var(--tx3); }
mark { background: transparent; color: var(--ac); font-weight: 600; }

/* ===== Oyna (modal) ===== */
.ovl { position: fixed; inset: 0; background: rgba(15, 20, 24, .42); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: var(--sf); border-radius: 10px; box-shadow: var(--sh-lg); width: 560px; max-width: 100%; display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.sm { width: 420px; } .modal.wide { width: 880px; } .modal.xl { width: 1180px; }
.modal-h { padding: 16px 20px 0; display: flex; align-items: center; gap: 10px; }
.modal-h h2 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; }
.modal-b { padding: 16px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--bd); display: flex; gap: 8px; justify-content: flex-end; background: var(--sf2); border-radius: 0 0 10px 10px; align-items: center; }
.confirm-warn { background: var(--red-soft); color: var(--red); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; font-size: 13.5px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }

/* ===== Xabar (toast) ===== */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2326; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--sh-lg); display: flex; align-items: center; gap: 12px; font-size: 13.5px; animation: pop .15s; max-width: 640px; }
.toast.err { background: var(--red); } .toast.ok .ic { color: #7fe0b5; }
.toast button { background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 5px; padding: 3px 10px; cursor: pointer; font-weight: 600; }

/* ===== Menyular ===== */
.menu { position: fixed; z-index: 1000; background: var(--sf); border: 1px solid var(--bd2); border-radius: var(--r); box-shadow: var(--sh-lg); padding: 4px; min-width: 220px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; color: var(--tx); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--sf3); }
.menu hr { border: 0; border-top: 1px solid var(--bd); margin: 4px 0; }
.menu .danger { color: var(--red); }
.notif { width: 420px; max-height: 70vh; overflow-y: auto; }
.notif .it { display: flex; gap: 10px; padding: 9px 10px; border-radius: 5px; cursor: pointer; font-size: 13.5px; align-items: flex-start; }
.notif .it:hover { background: var(--sf3); }
.bell { position: relative; } .bell .n { position: absolute; top: 3px; right: 3px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }

/* ===== Sozlamalar ===== */
.set { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.set-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 1px; }
.set-nav a { padding: 8px 12px; border-radius: var(--r-sm); color: var(--tx2); font-weight: 500; text-decoration: none; display: flex; gap: 10px; align-items: center; }
.set-nav a:hover { background: var(--sf3); } .set-nav a.on { background: var(--ac-soft); color: var(--ac); }
.set-sec { margin-bottom: 18px; }
.set-row { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--bd); align-items: center; }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl b { display: block; font-weight: 500; } .set-row .lbl small { color: var(--tx3); display: block; margin-top: 2px; font-size: 12.5px; }
.set-row .ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.set-row .ctl input:not([type=checkbox]), .set-row .ctl select { width: 260px; max-width: 100%; }
.switch { position: relative; width: 36px; height: 20px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--bd2); border-radius: 10px; transition: .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--ac); } .switch input:checked + span::after { left: 18px; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--ac-ring); }
.preset { border: 1px solid var(--bd2); border-radius: var(--r); padding: 14px; cursor: pointer; background: var(--sf); text-align: left; }
.preset:hover { border-color: var(--ac); } .preset.on { border-color: var(--ac); background: var(--ac-soft); box-shadow: 0 0 0 1px var(--ac); }
.preset b { display: block; margin-bottom: 4px; } .preset span { color: var(--tx2); font-size: 13px; }

/* ===== Kassa (POS) ===== */
.pos { display: grid; grid-template-columns: 1fr 400px; height: calc(100vh - var(--top)); }
.pos-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--bd); background: var(--sf); }
.pos-bar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--bd); align-items: center; }
.pos-scan { flex: 1; position: relative; } .pos-scan input { width: 100%; height: 44px; font-size: 16px; padding-left: 40px; }
.pos-scan .ic { position: absolute; left: 12px; top: 13px; color: var(--tx3); }
.pos-lines { flex: 1; overflow-y: auto; }
.pos-lines .tbl td { height: 50px; font-size: 15px; }
.pos-lines .tbl tr.cur td { background: var(--ac-soft); }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--bd2); border-radius: 6px; }
.qty-ctl button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--tx2); }
.qty-ctl input { width: 64px; height: 30px; border: 0; text-align: center; box-shadow: none !important; }
.pos-quick { border-top: 1px solid var(--bd); padding: 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 210px; overflow-y: auto; background: var(--sf2); }
.qbtn { border: 1px solid var(--bd); background: var(--sf); border-radius: 8px; padding: 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 58px; }
.qbtn:hover { border-color: var(--ac); } .qbtn b { font-weight: 600; font-size: 13.5px; line-height: 1.2; } .qbtn small { color: var(--tx3); font-variant-numeric: tabular-nums; }
.qbtn img { width: 100%; height: 48px; object-fit: cover; border-radius: 4px; }
.pos-right { display: flex; flex-direction: column; background: var(--sf2); min-height: 0; }
.pos-tabs { display: flex; gap: 4px; padding: 10px 12px 0; flex-wrap: wrap; }
.pos-tabs button { border: 1px solid var(--bd); background: var(--sf); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; color: var(--tx2); }
.pos-tabs button.on { border-color: var(--ac); color: var(--ac); font-weight: 600; background: var(--ac-soft); }
.pos-sum { padding: 14px 16px; flex: 1; overflow-y: auto; }
.pos-total { font-size: 34px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 4px 0 10px; }
.pos-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--bd); }
.pos-pay .btn { height: 52px; font-size: 15px; }
.pos-pay .btn.primary { grid-column: span 2; height: 58px; font-size: 18px; }
.paygrid { display: grid; grid-template-columns: 1fr 160px; gap: 8px 12px; align-items: center; }
.paygrid input { height: 40px; font-size: 16px; text-align: right; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keys button { height: 44px; border: 1px solid var(--bd); border-radius: 6px; background: var(--sf); font-size: 17px; cursor: pointer; }
.keys button:hover { background: var(--sf3); }
.shift-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: 13px; color: var(--tx2); border-bottom: 1px solid var(--bd); background: var(--sf); container-type: inline-size; min-height: 46px; }
.sb-info { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; }
.sb-info > * { flex: none; } .sb-info > span:last-child { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.sb-dot { color: var(--tx3); }
.sb-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.sb-acts .btn { white-space: nowrap; }
@container (max-width: 640px) { .sb-acts .lbl { display: none; } .sb-acts .btn.sm { padding: 0 8px; } }

/* ===== Pechat markazi ===== */
.pc { display: grid; grid-template-columns: 1fr 320px; height: 78vh; gap: 0; }
.pc-prev { background: #e9ebed; overflow: auto; padding: 24px; display: flex; justify-content: center; }
[data-theme="dark"] .pc-prev { background: #0d0f10; }
.pc-prev iframe { border: 0; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
.pc-set { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--bd); }
.pc-set .field select, .pc-set .field input { height: 32px; }

/* ===== Turli ===== */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps div { flex: 1; height: 4px; border-radius: 2px; background: var(--bd); } .steps div.on { background: var(--ac); }
.note { background: var(--blue-soft); color: var(--blue); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.note.warn { background: var(--amber-soft); color: var(--amber); } .note.bad { background: var(--red-soft); color: var(--red); } .note.ok { background: var(--green-soft); color: var(--green); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; } .kv > :nth-child(odd) { color: var(--tx3); }
.drop { border: 2px dashed var(--bd2); border-radius: var(--r); padding: 28px; text-align: center; color: var(--tx2); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--ac); background: var(--ac-soft); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
hr.sep { border: 0; border-top: 1px solid var(--bd); margin: 14px 0; }
.help-keys { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ac-soft); color: var(--ac); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.userbtn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--tx); }
.userbtn:hover { background: var(--sf3); }
.userbtn .meta { text-align: left; line-height: 1.15; } .userbtn .meta small { color: var(--tx3); font-size: 11.5px; display: block; }
.ctemplate { font-family: "Times New Roman", serif; font-size: 14px; line-height: 1.5; min-height: 420px; }
@media (max-width: 1100px) { .doc { grid-template-columns: 1fr; } .doc-side { position: static; } .pos { grid-template-columns: 1fr 340px; } }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } .side { display: none; } .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .g4, .g3, .g6 { grid-template-columns: 1fr 1fr; } .set { grid-template-columns: 1fr; } .set-row { grid-template-columns: 1fr; } }
@media print { body * { visibility: hidden; } }

/* ===== Pechat oynasi (Excel uslubida) ===== */
.modal.pv-modal { width: min(1400px, 96vw); height: 92vh; position: relative; }
.modal.pv-modal .modal-h { position: absolute; right: 10px; top: 9px; padding: 0; z-index: 5; }
.modal.pv-modal .modal-h h2 { display: none; }
.modal.pv-modal .modal-b { padding: 0; flex: 1; min-height: 0; }
.ovl:has(.pv-modal) { padding: 3vh 16px; }
.pv { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.pv-side { border-right: 1px solid var(--bd); padding: 18px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; background: var(--sf); border-radius: 10px 0 0 10px; }
.pv-top { display: flex; gap: 12px; align-items: stretch; margin-bottom: 8px; }
.pv-go { width: 92px; height: 92px; border: 1px solid var(--bd2); background: var(--sf2); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 600; color: var(--tx); }
.pv-go .ic { width: 32px; height: 32px; }
.pv-go:hover { background: var(--sf3); border-color: var(--tx3); }
.pv-copies { display: flex; flex-direction: column; justify-content: center; gap: 6px; font-weight: 500; color: var(--tx2); }
.pv-spin { display: inline-flex; border: 1px solid var(--bd2); border-radius: 6px; overflow: hidden; width: 132px; }
.pv-spin button { width: 34px; border: 0; background: var(--sf2); cursor: pointer; font-size: 16px; color: var(--tx2); }
.pv-spin input { width: 64px; border: 0; border-radius: 0; text-align: center; box-shadow: none !important; }
.pv-h { font-size: 15px; font-weight: 600; margin: 12px 0 4px; color: var(--tx); }
.pv-sel { width: 100%; display: flex; align-items: center; gap: 12px; padding: 7px 10px; border: 1px solid var(--bd2); border-radius: 6px; background: var(--sf); cursor: pointer; text-align: left; color: var(--tx); margin-bottom: 6px; }
.pv-sel:hover { border-color: var(--tx3); background: var(--sf2); }
.pv-sel > .ic { margin-left: auto; color: var(--tx3); width: 16px; }
.pv-sel-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pv-sel-t b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-sel-t small { color: var(--tx3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-ic { width: 30px; height: 30px; flex: none; color: var(--tx2); }
.pv-ic.big { width: 34px; height: 34px; }
.pv-menu { max-height: 60vh; overflow-y: auto; }
.pv-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; text-align: left; color: var(--tx); }
.pv-menu button:hover { background: var(--sf3); }
.pv-menu button.on { background: var(--ac-soft); }
.pv-sub { gap: 6px; margin: -2px 0 8px 52px; font-size: 13px; color: var(--tx2); }
.pv-sub input { height: 30px; }
.pv-mg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: -2px 0 8px 52px; }
.pv-mg label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--tx2); }
.pv-mg input { height: 30px; width: 100%; }
.pv-more { margin-top: 6px; border-top: 1px solid var(--bd); padding-top: 10px; }
.pv-more summary { cursor: pointer; font-weight: 500; color: var(--tx2); }
.pv-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.pv-foot .btn { flex: 1; }
.pv-note { font-size: 12px; color: var(--tx3); margin-top: 6px; }
.pv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e8eaec; border-radius: 0 10px 10px 0; }
[data-theme="dark"] .pv-main { background: #0d0f10; }
.pv-bar { display: flex; align-items: center; gap: 12px; padding: 10px 56px 10px 16px; border-bottom: 1px solid var(--bd); background: var(--sf); border-radius: 0 10px 0 0; }
.pv-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-stage { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px; }
.pv-loading { color: var(--tx3); margin-top: 20vh; }
.pv-sheet { flex: none; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.10); background: #fff; }
.pv-sheet-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; }
.pv-clip { position: absolute; overflow: hidden; }
.pv-clip iframe { position: absolute; left: 0; border: 0; background: #fff; pointer-events: none; }
.pv-mguide { position: absolute; outline: 1px dashed #7aa2e3; pointer-events: none; }
.pv-nav { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; border-top: 1px solid var(--bd); background: var(--sf); color: var(--tx2); font-size: 13px; border-radius: 0 0 10px 0; }
