:root {
  --bg: #f5faff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #0284c7;          /* asosiy tugmalar: havorang */
  --primary-2: #e0f2fe;        /* yengil havorang fon */
  --gold: #38bdf8;
  --gold-light: #e0f2fe;
  --gold-dark: #0284c7;
  --ink: #0c4a6e;
  --sidebar-bg: linear-gradient(180deg, #0c4a6e 0%, #082f49 100%);
  --topbar-bg: #0c4a6e;
  --serif: 'Inter Variable', Inter, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --green: #059669;
  --green-bg: #d1fae5;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  --sidebar: 232px;
  font-family: 'Inter Variable', Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}

/* Qorong'u rejim (Dark theme) */
body.dark-theme {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --ink: #f8fafc;
  --shadow: 0 4px 20px rgba(0, 0, 0, .4);
}
body.dark-theme .card, body.dark-theme .modal, body.dark-theme .ac-list {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
body.dark-theme input, body.dark-theme select, body.dark-theme textarea {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}
body.dark-theme .btn {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
body.dark-theme .btn:hover {
  background: #475569;
}
body.dark-theme .btn.primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}
body.dark-theme table.t th {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}
body.dark-theme table.t td {
  border-color: var(--border);
}
body.dark-theme table.t tr.click:hover td {
  background: var(--surface-2);
}
body.dark-theme table.t tfoot td {
  background: var(--surface-2);
}
body.dark-theme .chip {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
body.dark-theme .chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
body.dark-theme .pos-tile {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-theme .pos-tile:hover {
  border-color: var(--primary);
}
body.dark-theme .scan-test, body.dark-theme .tips {
  background: var(--surface-2);
  border-color: var(--border);
}

.num, table.t td.num, table.t th.num, .nowrap, .stat .v, .balance-big, .big-price {
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
[v-cloak] { display: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; background: var(--sidebar-bg, linear-gradient(180deg, #0c4a6e 0%, #082f49 100%)); color: #bae6fd;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar .brand { padding: 18px 18px 14px; font-weight: 700; font-size: 16px; color: #fff; display: flex; gap: 8px; align-items: center; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: #bae6fd; font-size: 14px; position: relative;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.sidebar nav a.active { background: rgba(125, 211, 252, .13); color: #f0f9ff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(180deg, #f0f9ff, #38bdf8); border-radius: 0 3px 3px 0; }
.sidebar nav .ico { width: 20px; text-align: center; }
.sidebar .badge { margin-left: auto; }
.sidebar .user { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.sidebar .user a { color: #7dd3fc; }

.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.page-head .back { font-size: 20px; color: var(--muted); }

@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    background: var(--topbar-bg, #0c4a6e); color: #f0f9ff; padding: 8px 14px; border-bottom: 1px solid rgba(125, 211, 252,.25);
  }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; padding: 0 4px; }
  .topbar .t { font-weight: 600; flex: 1; }
  .main { padding: 14px 12px 80px; }
  h1 { font-size: 19px; }
}

/* ---------- Cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .row > .card + .card { margin-top: 0; }
.card.p0 { padding: 0; overflow-x: auto; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: 1fr; }
  .grid.c3 > * { grid-column: auto !important; }
}
@media (max-width: 700px) { .grid.c2, .grid.c3 { grid-template-columns: 1fr; } .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.stat { padding: 14px 16px; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.stat .v { font-size: 20px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (max-width: 700px) { .stat .v { font-size: 16px; } }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.bold { font-weight: 600; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.btn.primary:hover { background: #0369a1; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--surface); border-color: #fca5a5; color: var(--red); }
.btn.red:hover { background: var(--red-bg); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 6px 9px; }

input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--surface); width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-2); border-color: var(--gold); }
textarea { min-height: 70px; resize: vertical; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: auto; }

.search-big { position: relative; flex: 1; min-width: 220px; }
.search-big input { padding: 11px 14px 11px 38px; font-size: 15px; border-radius: 10px; }
.search-big::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; color: var(--text); white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.chip .n { opacity: .7; margin-left: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--gold); font-weight: 600; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.gray { background: #eceef2; color: #4b5563; }
.badge.purple { background: var(--primary-2); color: var(--gold-dark); }
.sidebar .badge { background: #ef4444; color: #fff; }

/* ---------- Tables (telefonda kartochkaga aylanadi) ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f3f6f9; }
table.t tr.dim td { opacity: .55; }
table.t tfoot td { font-weight: 700; background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }

@media (max-width: 820px) {
  table.rt thead { display: none; }
  table.rt, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; }
  table.rt tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  table.rt td { border: 0; padding: 3px 0 3px 112px; position: relative; text-align: right; min-height: 24px; }
  table.rt td::before { content: attr(data-l); position: absolute; left: 0; top: 4px; max-width: 108px; color: var(--muted); font-size: 12px; text-align: left; }
  table.rt td[data-l=""], table.rt td:not([data-l]) { padding-left: 0; }
  table.rt td[data-l=""]::before, table.rt td:not([data-l])::before { content: none; }
  table.rt td.main-cell { font-size: 15px; text-align: left; padding-left: 0; }
  table.rt td.num { text-align: right; }
  table.rt tfoot { display: block; }
  table.rt tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 12px; background: var(--surface-2); }
  table.rt tfoot td { display: block; padding: 0 !important; min-height: 0; text-align: left; background: none; }
  table.rt tfoot td:empty { display: none; }
  table.rt tfoot td::before { position: static; margin-right: 6px; }
}
/* Planshet: jadval kataklari ixchamroq */
@media (min-width: 821px) and (max-width: 1280px) {
  table.t th, table.t td { padding: 8px 8px; }
}

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16, 22, 28, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 960px; }
.modal .mh { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal .mh h2 { margin: 0; flex: 1; }
.modal .mb { padding: 18px; }
.modal .mf { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) { .modal-bg { padding: 0; align-items: stretch; } .modal { border-radius: 0; min-height: 100vh; } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: #1e293b; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 14px; white-space: pre-line; }
.toast.error { background: #991b1b; }
.toast.ok { background: #065f46; }
.toast .act { margin-left: 10px; color: #e0f2fe; cursor: pointer; font-weight: 600; text-decoration: underline; }
@media (max-width: 600px) { .toasts { left: 12px; right: 12px; } }

/* ---------- Autocomplete ---------- */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); max-height: 320px; overflow-y: auto; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.ac-item:hover, .ac-item.hl { background: var(--primary-2); }
.ac-item .sub { color: var(--muted); font-size: 12px; }

/* ---------- Items editor ---------- */
.items-ed .it { display: grid; grid-template-columns: minmax(180px, 2.4fr) 110px 80px 90px 130px 130px 34px; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.items-ed .it .tot { font-weight: 600; text-align: right; padding: 9px 0; white-space: nowrap; }
.items-ed .hdr { font-size: 12px; color: var(--muted); padding-bottom: 0; border: 0; }
.items-ed .sub { font-size: 12px; color: var(--muted); grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 900px) {
  .items-ed .it { grid-template-columns: 1fr 1fr 1fr; }
  .items-ed .it .prod { grid-column: 1 / -1; }
  .items-ed .hdr { display: none; }
  .items-ed .it .tot { text-align: right; align-self: end; }
  .items-ed .it > div:last-of-type:not(.sub) { justify-self: end; }
}
.unit-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.unit-toggle button { flex: 1; border: 0; background: var(--surface); padding: 8px 4px; font: inherit; font-size: 13px; cursor: pointer; }
.unit-toggle button.on { background: var(--primary); color: #ffffff; }
.mini-l { display: none; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
@media (max-width: 900px) { .mini-l { display: block; } }

.totals-box { margin-left: auto; max-width: 380px; }
.totals-box .tr { display: flex; justify-content: space-between; padding: 5px 0; gap: 12px; }
.totals-box .tr.big { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }

.balance-big { font-size: 28px; font-weight: 800; }
.result-box { border-radius: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); }
.result-box .tr { display: flex; justify-content: space-between; padding: 3px 0; }

.timeline-amt { font-weight: 600; white-space: nowrap; }
.prod-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }

.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px 16px; background: radial-gradient(ellipse at 50% 30%, #075985 0%, #0c4a6e 55%, #10161c 100%); }
.login-wrap .card { width: 100%; max-width: 360px; padding: 26px; }

/* ---------- Hujjat (nakladnoy / KP) ---------- */
.doc-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.doc-scroll { overflow-x: auto; }
.doc {
  background: #fff; color: #000; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm 12mm;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .12); font-family: "Times New Roman", Times, serif; font-size: 12.5px; line-height: 1.35;
}
.doc h1 { font-size: 18px; text-align: center; margin: 4px 0 2px; text-transform: uppercase; letter-spacing: .02em; }
.doc .doc-sub { text-align: center; margin-bottom: 14px; }
.doc .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.doc .parties .p { border: 1px solid #000; padding: 6px 8px; }
.doc .parties .p b.h { display: block; text-transform: uppercase; font-size: 11px; margin-bottom: 3px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc table th, .doc table td { border: 1px solid #000; padding: 4px 5px; }
.doc table th { background: #efefef; font-size: 11.5px; text-align: center; }
.doc table td.n { text-align: right; white-space: nowrap; }
.doc table td.c { text-align: center; }
.doc table tfoot td { font-weight: 700; }
.doc .words { margin: 8px 0; }
.doc .bal { margin-top: 10px; width: 60%; margin-left: auto; }
.doc .bal td { border: 1px solid #000; padding: 3px 6px; }
.doc .signs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 34px; }
.doc .signs div { border-top: 1px solid #000; padding-top: 4px; font-size: 11.5px; }
.doc .head-row { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.doc .head-row .co { font-size: 16px; font-weight: 700; }
.doc .doc-logo { display: inline-block; vertical-align: middle; }
.doc .doc-logo svg { height: 48px; width: auto; max-width: 220px; }
.doc table td.doc-img-cell { padding: 3px !important; text-align: center; vertical-align: middle; }
.doc-prod-img { width: 58px; height: 58px; object-fit: contain; background: #fff; border: 1px solid #ddd; border-radius: 4px; display: block; margin: 0 auto; }
.doc-no-img { color: #aaa; font-size: 11px; }
.doc .note { margin-top: 12px; white-space: pre-line; }
.doc .stamp { margin-top: 6px; font-size: 11px; color: #444; }
@media (max-width: 900px) { .doc { transform-origin: top left; } }

@media print {
  @page { size: A4; margin: 0; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #fff !important; }
  .sidebar, .topbar, .no-print, .doc-toolbar, .toasts, .backdrop, .page-head { display: none !important; }
  .main { padding: 0 !important; }
  .layout { display: block; }
  .doc-scroll { overflow: visible; }
  .doc { box-shadow: none; margin: 0; width: auto; min-height: auto; }
  .doc table td.doc-img-cell { padding: 2px !important; }
  .doc-prod-img { width: 56px !important; height: 56px !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .print-hide-others > *:not(.print-area) { display: none !important; }
}

/* ================= POS ================= */
.pos-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; -webkit-overflow-scrolling: touch; }
.pos-wrap > * { min-width: 0; }
.pos-left { -webkit-overflow-scrolling: touch; }
.pos-tools { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.pos-btns { display: flex !important; gap: 6px; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.pos-btns::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.pos-btns .btn { flex-shrink: 0 !important; white-space: nowrap !important; padding: 7px 11px; touch-action: manipulation; }
.pos-tools .chips { display: flex !important; gap: 6px; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; margin: 0; }
.pos-tools .chips::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.pos-tools .chips .chip { flex-shrink: 0 !important; white-space: nowrap !important; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.pos-tile {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  cursor: pointer; user-select: none; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  touch-action: manipulation;
}
.pos-tile:hover {
  transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); border-color: #cbd5e1;
}
.pos-tile:active { transform: scale(0.97); }
.pos-tile.pos-out { border: 1.5px solid #fca5a5; background: #fffafa; }

/* 1. Rasm — to'liq, katta va chiroyli ko'rinish */
.pos-card-img {
  position: relative; width: 100%; aspect-ratio: 1 / 1; min-height: 150px; max-height: 195px;
  border-radius: 10px; background: #ffffff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border: 1px solid var(--border); padding: 6px; box-sizing: border-box;
}
body.dark-theme .pos-card-img { background: var(--surface-2); border-color: var(--border); }
.pos-card-img img {
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: contain; object-position: center;
  transition: transform .22s ease;
}
.pos-tile:hover .pos-card-img img { transform: scale(1.06); }
.pos-no-img { font-size: 46px; opacity: 0.5; }

/* 2. Kodi & Holat */
.pos-card-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 18px; }
.pos-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700;
  color: var(--primary); background: var(--surface-2); padding: 1.5px 6px; border-radius: 5px; border: 1px solid var(--border);
}
.pos-card-code.empty { color: var(--muted); }

/* 3. Nomi */
.pos-card-name {
  font-weight: 700; font-size: 13px; line-height: 1.25; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px;
}

/* 4. Karobkada dona */
.pos-card-box {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #475569;
  background: var(--surface-2); padding: 2.5px 7px; border-radius: 5px; border: 1px solid var(--border); width: fit-content;
}
.pos-card-box b { color: var(--text); }

/* 5. Sotuv narxi */
.pos-card-prices {
  display: flex; flex-direction: column; gap: 2px; background: var(--surface-2);
  padding: 5px 7px; border-radius: 7px; border: 1px dashed var(--border);
}
.pos-price-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); }
.pos-price-row.highlight { color: var(--text); }
.pos-price-row.highlight .pos-price-val { color: var(--primary); font-size: 13px; font-weight: 800; }
.pos-price-val { font-weight: 700; }

/* 6. Qoldiq (Astatka) */
.pos-card-stock {
  font-size: 11px; font-weight: 600; padding: 3px 6px; border-radius: 5px; text-align: center; margin-top: auto;
}
.pos-card-stock.stock-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pos-card-stock.stock-low { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pos-card-stock.stock-out { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 700; }
.stock-box-hint { font-weight: 500; opacity: 0.85; }

.pos-tile .img { aspect-ratio: 1 / 1; border-radius: 10px; background: #ffffff; display: flex; align-items: center; justify-content: center; font-size: 38px; overflow: hidden; margin-bottom: 4px; padding: 6px; }
.pos-tile .img img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.pos-tile .nm { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.pos-tile .pr { font-size: 12px; color: var(--muted); }
.pos-tile .pr.sel { color: var(--text); }
.pos-tile .pr.sel b { color: var(--primary); }
.pos-info { position: absolute; top: 14px; right: 14px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,.95); font-weight: 700; font-style: italic; font-family: Georgia, serif; cursor: pointer; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.pos-in { position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--primary); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 2px 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.pos-branch-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--primary); white-space: nowrap; }
.pos-sku { font-family: monospace; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); width: fit-content; letter-spacing: .2px; }
.prod-thumb-empty { width: 50px; height: 50px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--border); font-size: 24px; }
.pos-vibr-chips { display: flex; gap: 4px; flex-wrap: wrap; margin: 3px 0 5px; }
.vibr-chip { padding: 2px 6px; font-size: 11px; font-weight: 600; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; line-height: 1.2; transition: all .1s; }
.vibr-chip:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.vibr-chip.more { background: transparent; color: var(--primary); }
.pos-card-assort { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-weight: 600; color: var(--primary); width: fit-content; cursor: pointer; transition: all .12s ease; }
.pos-card-assort:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.pos-cart {
  position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden; padding: 0;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
}
.pos-cart::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.pos-cart-in { display: flex; flex-direction: column; }
.pos-sec { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pos-line { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.pos-line:last-of-type { border-bottom: 0; }
.pos-actions { padding: 12px 14px; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 5; }
.pos-go { width: 100%; padding: 13px; font-size: 15.5px; font-weight: 700; border-radius: 10px; touch-action: manipulation; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .btn { min-width: 32px; height: 32px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 6px; touch-action: manipulation; }
.stepper input { width: 50px; height: 32px; text-align: center; padding: 4px; }
.unit-toggle.sm button { padding: 5px 8px; font-size: 12px; }
.grow { flex: 1; min-width: 0; }

.pos-li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); cursor: pointer; }
.pos-li:hover { border-color: #7dd3fc; background: #f3f6f9; }
.pos-li.dim { opacity: .55; }

.pos-drawer-bg { position: fixed; inset: 0; background: rgba(16, 22, 28, .35); z-index: 80; }
.pos-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--bg); z-index: 81;
  overflow-y: auto; overflow-x: hidden; box-shadow: -10px 0 40px rgba(0,0,0,.2); animation: posIn .16s ease-out;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
}
.pos-drawer::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
@keyframes posIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.pos-drawer .ph { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pos-drawer .ph .pt { flex: 1; min-width: 0; }
.pos-drawer .ph .pt .bold { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-drawer .pb { padding: 14px; }
.pos-drawer .pos-cart-in .pos-sec { padding-left: 0; padding-right: 0; }
.pos-drawer .pos-actions { margin: 0 -14px -14px; }

.pos-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 13px 16px calc(13px + env(safe-area-inset-bottom)); background: var(--primary); color: #fff; font-size: 15px;
  cursor: pointer; box-shadow: 0 -6px 20px rgba(0,0,0,.15); touch-action: manipulation;
}

/* Tablet moslashuvi: 768px - 1100px (iPad, Android planshetlar) */
@media (min-width: 768px) and (max-width: 1100px) {
  .pos-wrap { grid-template-columns: minmax(0, 1fr) 320px; gap: 10px; }
  .pos-tools { top: 46px; }
  .pos-cart { top: 56px; max-height: calc(100vh - 66px); }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
  .pos-tile { padding: 8px; gap: 5px; border-radius: 12px; }
  .pos-card-img { aspect-ratio: 1 / 1; min-height: 130px; max-height: 160px; padding: 5px; }
  .pos-card-name { font-size: 12.5px; min-height: 30px; }
  .pos-btns { flex-wrap: nowrap !important; overflow-x: auto !important; gap: 5px; padding-bottom: 2px; }
  .pos-btns .btn { flex-shrink: 0 !important; padding: 6px 9px; font-size: 12px; white-space: nowrap !important; }
}

/* Telefon moslashuvi: < 768px */
@media (max-width: 767px) {
  .pos-wrap { grid-template-columns: minmax(0, 1fr); padding-bottom: 75px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pos-tile { padding: 8px; gap: 4px; border-radius: 12px; }
  .pos-card-img { aspect-ratio: 1 / 1; min-height: 130px; max-height: 170px; padding: 5px; }
  .pos-card-name { font-size: 12px; min-height: 28px; line-height: 1.2; }
  .pos-tools { top: 44px; gap: 5px; padding: 4px 0 6px; }
  .pos-tools > .row { flex-wrap: nowrap !important; overflow-x: auto; gap: 4px; align-items: center; }
  .pos-tools > .row::-webkit-scrollbar { display: none !important; width: 0; height: 0; }
  .pos-tools .pos-branch-badge { display: none !important; }
  .pos-tools .pos-reg { display: none !important; }
  .pos-tools .pos-display-btn { display: none !important; }
  .pos-tools .search-big { min-width: 0 !important; flex: 1 !important; }
  .pos-tools .search-big input { padding: 8px 10px 8px 32px; font-size: 13px; }
  .pos-tools .search-big::before { font-size: 12px; left: 9px; }
  .pos-tools .unit-toggle button { padding: 5px 8px; font-size: 11.5px; }
  .pos-btns { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 5px; padding-bottom: 2px; }
  .pos-btns::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  .pos-btns .btn { flex-shrink: 0 !important; padding: 6px 9px; font-size: 12px; white-space: nowrap !important; }
  .pos-tools .chips { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 5px; padding-bottom: 2px; }
  .pos-tools .chips::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  .pos-tools .chips .chip { flex-shrink: 0 !important; padding: 4px 10px; font-size: 12px; white-space: nowrap !important; }
  .hw-status { display: none !important; }
}

/* POS ichidan chop etish: faqat hujjat chiqadi */
.print-portal { display: none; }
@media print {
  body.print-doc #app { display: none !important; }
  body.print-doc .print-portal { display: block; }
  body.print-doc .print-portal .doc { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 0; }
}

.new-version { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--primary); color: #fff; padding: 8px 10px 8px 16px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; align-items: center; gap: 12px; font-size: 14px; }
.new-version .btn { background: #fff; color: var(--primary); border-color: #fff; }
@media print { .new-version { display: none !important; } }

/* Telefonda PDF yaratish uchun hujjat ekrandan tashqarida chiziladi */
body.pdf-render .print-portal { display: block; position: fixed; left: -10000px; top: 0; width: 210mm; background: #fff; }

/* PDF tayyor oynasi (telefon / mobil) */
.pdf-sheet-bg { position: fixed; inset: 0; z-index: 2000; background: rgba(16,22,28,.45); display: flex; align-items: flex-end; justify-content: center; }
.pdf-sheet { width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.pdf-sheet .ps-head { display: flex; align-items: center; gap: 8px; } .pdf-sheet .ps-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-sheet .ps-big { width: 100%; padding: 14px; font-size: 16px; display: flex; flex-direction: column; gap: 2px; }
.pdf-sheet .ps-big small { font-size: 12px; font-weight: 400; opacity: .8; }
.pdf-sheet .ps-wait { padding: 22px 0; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media print { .pdf-sheet-bg { display: none !important; } }
/* Hujjat sahifalari: 25 qatordan keyin yangi sahifa; qator ikkiga bo'linmaydi */
.doc .page-break { page-break-before: always; break-before: page; height: 0; }
/* Ekranda: sahifa chegarasi — alohida varaq kabi bo'shliq (chop etish va PDF'da ko'rinmaydi) */
@media screen {
  .doc:not(.pdf-mode) .page-break { height: 34px; margin: 16mm -12mm 14mm; background: var(--bg); box-shadow: inset 0 8px 10px -8px rgba(0,0,0,.18), inset 0 -8px 10px -8px rgba(0,0,0,.18);
    display: flex; align-items: center; justify-content: center; }
  .doc:not(.pdf-mode) .page-break span { font: 600 11px Inter, sans-serif; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
}
.doc .page-break span { display: none; }
@media screen { .doc:not(.pdf-mode) .page-break span { display: inline; } }
.doc table.items { table-layout: fixed; }
.doc table.items td { overflow-wrap: anywhere; }
.doc table.items tr { page-break-inside: avoid; break-inside: avoid; }
.doc table.items thead { display: table-header-group; }
.doc .words, .doc table.bal, .doc .signs { page-break-inside: avoid; break-inside: avoid; }
/* Termo-chek: qora-oq, mayda shrift, chekka qog'oz kengligida */
.receipt { font: 12px/1.35 'Courier New', ui-monospace, monospace; color: #000; background: #fff; padding: 3mm 2mm; box-sizing: border-box; }
.receipt .rc-c { text-align: center; }
.receipt .rc-b { font-weight: 700; }
.receipt .rc-row { display: flex; justify-content: space-between; gap: 6px; }
.receipt .rc-row > :last-child { text-align: right; white-space: nowrap; }
.receipt .rc-item { margin: 2px 0; }
.receipt .rc-hr { border-top: 1px dashed #000; margin: 5px 0; }
@media (max-width: 600px) {
  .pos-btns { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 5px; }
  .pos-btns::-webkit-scrollbar { display: none !important; }
  .pos-btns .btn { flex-shrink: 0 !important; white-space: nowrap !important; }
}
.unit-fixed { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); font-size: 13px; text-align: center; }
.lang-sw { display: flex; gap: 4px; padding: 8px 18px; }
.lang-sw button { flex: 1; border: 1px solid rgba(255,255,255,.15); background: transparent; color: #bae6fd; border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 12px; cursor: pointer; }
.lang-sw button.on { background: linear-gradient(135deg, #f0f9ff, #38bdf8); border-color: #7dd3fc; color: #0c4a6e; font-weight: 600; }
.login-wrap .lang-sw button { color: var(--text); border-color: var(--border); }
.login-wrap .lang-sw button.on { color: #0c4a6e; }
.lang-btn { background: rgba(255,255,255,.12) !important; border: 1px solid rgba(255,255,255,.25) !important; border-radius: 6px; font-size: 12px !important; padding: 4px 8px !important; color: #fff; }
.sidebar .lang-sw { margin-top: auto; }
.sidebar .lang-sw + .user { margin-top: 0; }
.client-grid { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .client-grid { grid-template-columns: minmax(0, 1fr); } }


/* ================= Do'kon boshqaruv — dizayn ================= */
body { font-family: 'Inter Variable', Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
h1, .page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: .2px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 21px; }
.modal .mh h2 { font-size: 22px; }
.brand-logo { display: inline-flex; line-height: 0; }
.brand-logo svg { width: 100%; height: auto; display: block; }
.sidebar .brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(125, 211, 252,.18); margin-bottom: 8px; justify-content: center; }
.sidebar .brand .brand-logo { width: 170px; }
.sidebar nav a { font-size: 13.5px; letter-spacing: .1px; }
.sidebar .user { border-top-color: rgba(125, 211, 252,.18); color: #7dd3fc; }
.topbar .brand-logo { width: 34px; }
.topbar .t { color: #f0f9ff; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.topbar button { color: #f0f9ff; }
.card { border-color: var(--border); }
.stat .l { color: #64748b; letter-spacing: .06em; }
.stat .v { font-variant-numeric: tabular-nums; }
table.t th { background: #f8fafc; color: #64748b; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.btn { border-radius: 9px; }
.btn.green { background: #059669; border-color: #059669; }
.pos-go { background: linear-gradient(135deg, #1e293b, #0c4a6e) !important; border-color: #0c4a6e !important; color: #ffffff !important; letter-spacing: .3px; }
.pos-go:disabled { opacity: .45; }
.pos-bar { background: linear-gradient(135deg, #1e293b, #0c4a6e); color: #ffffff; border-top: 1px solid rgba(125, 211, 252,.4); }
.pos-in { background: #0c4a6e; color: #ffffff; }
.pos-info { color: var(--gold-dark); }
.pos-tile .pr.sel b { color: var(--gold-dark); }
.chip { border-color: var(--border); }
.search-big input { border-color: var(--border); }
.sidebar .badge { background: linear-gradient(135deg, #f0f9ff, #38bdf8); color: #0c4a6e; }
.topbar .badge { background: linear-gradient(135deg, #f0f9ff, #38bdf8) !important; color: #0c4a6e !important; }
/* Kirish sahifasi */
.login-wrap .login-logo { width: 230px; filter: drop-shadow(0 6px 24px rgba(125, 211, 252,.18)); }
.login-wrap .card { background: rgba(255,255,255,.97); border: 1px solid rgba(125, 211, 252,.35); box-shadow: 0 24px 70px rgba(0,0,0,.45); border-radius: 16px; }
.login-wrap .card h2 { text-align: center; color: var(--text); margin-bottom: 18px; }
.login-wrap .btn.primary { padding: 12px; font-size: 15px; letter-spacing: .3px; }
.login-wrap .lang-sw { padding: 0; }
.login-foot { color: #64748b; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
/* Hujjatlar: logotip (KP, Nakladnoy, qabul) */
.doc .head-row .doc-logo { height: 52px; width: auto; max-width: 140px; display: inline-flex; align-items: center; margin-bottom: 6px; }
.doc .head-row .doc-logo svg { height: 52px; width: auto; max-width: 140px; display: block; }
.sidebar nav .ico { width: 20px; height: 20px; display: inline-flex; color: #7dd3fc; opacity: .85; }
.sidebar nav .ico svg { width: 19px; height: 19px; }
.sidebar nav a.active .ico { color: #f0f9ff; opacity: 1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.red { background: var(--red); } .dot.green { background: var(--green); } .dot.amber { background: #c98a1b; }
.chip.active .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
/* Raqamlar doim oddiy (serif shriftda ham) */
:root { font-variant-numeric: lining-nums; }
/* Hujjatlar o'z klassik shriftida */
.doc h1 { font-family: "Times New Roman", Times, serif; font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.notice-gold { display: block; background: linear-gradient(90deg, #f3f6f9, #e9eef3); border-color: #c8d1da; color: #3b4b5c; text-decoration: none !important; }
.notice-gold b { color: #0c4a6e; }
table.t th, table.t th.num { white-space: normal; line-height: 1.25; }
/* Kassalar */
.reg-grid { align-items: start; }
.reg-card h2 { font-size: 24px; }
.reg-cash { background: linear-gradient(135deg, #0c4a6e, #075985); color: #ffffff; border-radius: 12px; padding: 12px 14px; }
.reg-cash .muted { color: #a9b3bd; }
.reg-cash .v { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.reg-cash small { font-family: 'Inter Variable', Inter, sans-serif; font-size: 13px; color: #a9b3bd; }
.pos-reg { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pos-reg select { padding: 6px 8px; font-weight: 600; border-color: #7dd3fc; background: #f8fafc; }
@media (max-width: 1100px) { .reg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .reg-grid > * { grid-column: auto !important; } }
@media (max-width: 700px) { .reg-grid { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 600px) {
  .pos-tools > .row:first-child { flex-wrap: nowrap !important; }
  .pos-reg { margin-left: auto; }
}

/* ---- Sharhlar ---- */
.stars-mini { color: #b08a2e; white-space: nowrap; }
.stars-v { color: #b08a2e; }
.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-card { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.grid.rv-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .grid.rv-stats .stat .v { font-size: 18px; } .grid.rv-stats .stat .l { font-size: 10px; } }
.review-card.dim { opacity: .55; }
.review-card .rc-body { flex: 1; min-width: 0; }
.review-card .rc-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.review-card .rc-head a { color: inherit; text-decoration: none; }
.review-card .rc-stars { color: #b08a2e; letter-spacing: 1px; margin-left: auto; white-space: nowrap; }
.review-card .rc-text { margin-top: 6px; white-space: pre-line; line-height: 1.45; overflow-wrap: anywhere; }
.review-card .rc-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) {
  .review-card { flex-wrap: wrap; }
  .review-card .rc-body { flex-basis: calc(100% - 64px); }
  .review-card .rc-actions { width: 100%; justify-content: flex-end; }
}

.calc-box { padding: 9px 12px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); font-weight: 600; }
/* ---- Ranglar ---- */
.cchip { display: inline-block; padding: 1px 8px; margin: 1px 3px 1px 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; line-height: 1.6; }
.color-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; }
.item-color { font-size: 12px; color: var(--muted); }
.color-sel { margin-top: 4px; font-size: 13px; padding: 4px 8px; }
.color-sel.need { border-color: var(--amber, #c98a1b); }
.amber-t { color: #b45309; }
/* Kategoriya tanlash ro'yxati */
.cat-ac .cat-list { max-height: 320px; overflow-y: auto; }
.cat-ac .ac-item { display: flex; align-items: center; gap: 8px; }
.cat-ac .ac-item.on { font-weight: 600; }
/* ---- Filiallar: egasi sahifasi va filial nomi ---- */
.sidebar .branch-name { margin: -4px 18px 8px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.07); color: #f0f9ff; font-size: 13px; font-weight: 600; }
.sidebar .back-branches { display: block; margin: 0 18px 10px; font-size: 13px; color: #7dd3fc; }
.owner-wrap { min-height: 100vh; background: var(--bg); }
.owner-top { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--ink); color: #f0f9ff; }
.owner-top .brand-logo { height: 34px; }
.owner-top a { color: #7dd3fc; }
.owner-top .lang-sw button { color: #7dd3fc; }
.owner-me { text-align: right; font-size: 14px; }
.owner-main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.owner-empty { text-align: center; padding: 48px 24px; max-width: 560px; margin: 24px auto; }
.owner-empty-ico { font-size: 44px; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.branch-card { display: flex; flex-direction: column; gap: 12px; }
.branch-card.dim { opacity: .7; }
.branch-info { display: grid; gap: 4px; font-size: 14px; }
.branch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
@media (max-width: 640px) {
  .owner-top { padding: 10px 16px; flex-wrap: wrap; }
  .owner-me { text-align: left; }
  .branch-grid { grid-template-columns: 1fr; }
}

/* ---- Yangi ko'rinish: dinamik SaaS palitra, yumaloq burchaklar, yumshoq soyalar ---- */
h1, .page-head h1 { font-weight: 700; font-size: 26px; letter-spacing: -.3px; color: var(--text); }
h2 { font-weight: 650; font-size: 18px; letter-spacing: -.2px; }
.modal .mh h2 { font-size: 19px; }
.sidebar { background: var(--sidebar-bg, linear-gradient(180deg, #0c4a6e 0%, #082f49 100%)); }
.sidebar .brand .brand-logo { width: 168px; }
.sidebar nav a { margin: 2px 10px; padding: 9px 12px; border-radius: 10px; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); }
.sidebar nav a.active { background: var(--primary, #0284c7); color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.sidebar nav a.active::before { display: none; }
.sidebar nav a.active .ico { color: #fff; }
.sidebar .badge { background: #f43f5e; color: #fff; }
.topbar { background: var(--topbar-bg, #0c4a6e); }
.topbar .badge { background: #f43f5e !important; color: #fff !important; }
.card { border-color: #e8ecf4; }
.btn { border-radius: 10px; }
.btn.primary { background: var(--primary, #0284c7); border-color: var(--primary, #0284c7); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn.primary:hover { filter: brightness(0.92); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(14, 165, 233,.18); border-color: var(--primary, #38bdf8); }
table.t th { background: #f8fafc; color: #64748b; }
.stat .v { color: var(--text); }
.chip.active { background: var(--primary, #0284c7); border-color: var(--primary, #0284c7); color: #fff; }
.lang-sw button.on { background: var(--primary, #0284c7); border-color: var(--primary, #0284c7); color: #fff; }
.login-wrap .lang-sw button.on { color: #fff; }
.login-wrap { background: radial-gradient(circle at 20% 10%, #0369a1 0%, #0c4a6e 45%, #082f49 100%); }
.login-wrap .login-logo { width: 220px; filter: drop-shadow(0 10px 30px rgba(14, 165, 233,.35)); }
.login-wrap .card { border-radius: 20px; box-shadow: 0 30px 80px rgba(15,12,41,.5); }
.login-foot { color: #7dd3fc; }
.pos-go { background: var(--primary, #0284c7) !important; border-color: var(--primary, #0284c7) !important; color: #fff !important; }
.pos-bar { background: var(--topbar-bg, #0c4a6e); }
.owner-top { background: var(--topbar-bg, #0c4a6e); }
.owner-top .lang-sw button { color: #bae6fd; }
.owner-top .lang-sw button.on { color: #fff; }
.branch-card { transition: transform .15s, box-shadow .15s; border-top: 4px solid var(--primary, #0ea5e9); }
.branch-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,23,42,.10); }
.branch-card.dim { border-top-color: #f43f5e; }

/* ---- SaaS Modular & Theme UI Components ---- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 10px; }
.theme-box { border: 2px solid var(--border); border-radius: 12px; padding: 12px 10px; cursor: pointer; text-align: center; background: var(--surface); transition: all .2s; }
.theme-box:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.theme-box.active { border-color: var(--primary); background: var(--primary-2, rgba(14, 165, 233,.06)); font-weight: 600; }
.theme-dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px; box-shadow: 0 2px 6px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.module-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; justify-content: space-between; transition: all .2s; }
.module-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.module-card.on { border-color: var(--primary); background: linear-gradient(to bottom, var(--surface), var(--primary-2)); }
.module-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.module-icon { font-size: 26px; line-height: 1; }
.module-info h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.module-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin: 0; }

.ui-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.ui-switch input { opacity: 0; width: 0; height: 0; }
.ui-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .25s; border-radius: 24px; }
.ui-switch .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .25s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ui-switch input:checked + .slider { background-color: var(--primary, #0284c7); }
.ui-switch input:checked + .slider:before { transform: translateX(20px); }
.sidebar .branch-name { background: rgba(125, 211, 252,.14); color: #e0f2fe; }
.owner-top .brand-logo { height: 40px; max-width: 140px; width: auto; }
.owner-me .muted { color: #7dd3fc; }
.branch-grid > .card + .card { margin-top: 0; }
.notice-gold { background: linear-gradient(135deg, #f0f9ff, #f0f9ff) !important; border-color: #bae6fd !important; color: #075985; }

/* ---------- Rollar va ruxsatlar ---------- */
.warn-box { background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s; }
.role-card:hover { box-shadow: 0 6px 24px rgba(2, 132, 199,.14); transform: translateY(-1px); }
.role-card.system { background: linear-gradient(135deg, #f0f9ff, #f8fafc); }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-2); display: grid; place-items: center; font-size: 18px; flex: none; }
.rc-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rc-bar > div { height: 100%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); border-radius: 3px; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-tags .tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--primary-2); color: var(--gold-dark); }
.rc-tags .tag.off { background: var(--surface-2); color: #a3acb9; text-decoration: line-through; }
.rc-actions { display: flex; gap: 6px; margin-top: auto; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.pg-head { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check.perm { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.check.perm input { margin-top: 2px; }
.check.perm.dis, .pg-head.dis { opacity: .55; cursor: default; }
.matrix-wrap { overflow-x: auto; }
.matrix th.c, .matrix td.c { text-align: center; white-space: nowrap; }
.matrix tr.grp td { background: var(--surface-2); font-weight: 600; color: var(--gold-dark); }
.matrix .yes { color: var(--green); font-weight: 700; }
.matrix .no { color: #cbd5e1; }

/* ---------- Universal mahsulot formasi ---------- */
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .form-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .form-grid.c3 { grid-template-columns: 1fr; } }
.form-sec { font-weight: 600; color: var(--gold-dark); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.check.f { flex-direction: row; display: flex; align-items: center; gap: 8px; }
.low-badge { background: var(--amber-bg); color: var(--amber); }

/* ---------- Xarid formasi ---------- */
.items-ed .it.pur { grid-template-columns: minmax(200px, 2.6fr) 170px 90px 140px 130px 34px; }
@media (max-width: 760px) { .items-ed .it.pur { grid-template-columns: 1fr 1fr; } }
.row.end { justify-content: flex-end; }

/* ---------- Narx etiketkalari ---------- */
.labels-sheet { display: flex; flex-wrap: wrap; gap: 6px; }
.label { background: #fff; color: #000; border: 1px dashed #cbd5e1; padding: 1.5mm 2mm; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; font-family: Arial, sans-serif; }
.label .lb-co { font-size: 7pt; text-align: center; }
.label .lb-name { font-size: 8pt; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.label .lb-price { font-size: 13pt; font-weight: 700; margin: 0.5mm 0; }
.label .lb-price small { font-size: 7pt; font-weight: 400; }
.label .lb-code { margin-top: auto; }
@media print {
  body.print-labels .sidebar, body.print-labels .topbar, body.print-labels .no-print, body.print-labels .toasts { display: none !important; }
  body.print-labels .main { padding: 0 !important; }
  body.print-labels .labels-sheet { display: block; }
  body.print-labels .label { border: 0; page-break-after: always; break-after: page; }
}

/* ---------- Xarajatlar: gorizontal ustunlar ---------- */
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 13px; }
.bar-row .bt { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-row .bf { display: block; height: 100%; background: linear-gradient(90deg, #0ea5e9, #38bdf8); border-radius: 5px; }
.bar-row .bv { white-space: nowrap; }

/* ---------- Kassa smenasi ---------- */
.shift-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.shift-bar .small { flex: 1; min-width: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #94a3b8; flex: none; }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: #f59e0b; }
.z-report { font-size: 13px; }
.z-report .tr { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.z-report .tr.big { font-size: 15px; }
.z-report .rc-hr { border-top: 1px dashed var(--border); margin: 6px 0; }
.z-report .center { text-align: center; }
.z-tbl { width: 100%; border-collapse: collapse; }
.z-tbl th { font-weight: 500; color: var(--muted); text-align: right; font-size: 12px; }
.z-tbl td { padding: 2px 0; } .z-tbl td.n { text-align: right; }
@media print {
  body.print-z #app > *:not(.modal-bg), body.print-z .modal-bg .mh, body.print-z .modal-bg .mf { display: none !important; }
  body.print-z .modal-bg { position: static; background: none; }
  body.print-z .modal { box-shadow: none; width: auto; max-width: none; }
  body.print-z .z-report { font: 12px/1.35 'Courier New', monospace; color: #000; }
}

/* ---------- Hisobotlar ---------- */
.stat.hero .v { font-size: 26px; }
.t.pl td { padding: 6px 4px; }
.t.pl tr.b td { font-weight: 700; border-top: 1px solid var(--border); }
.t.pl tr.big td { font-size: 16px; }
.day-chart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 180px auto; gap: 4px 8px; }
.dc-axis { position: relative; font-size: 11px; color: var(--muted); min-width: 64px; }
.dc-axis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.dc-plot { position: relative; border-bottom: 1px solid var(--border); }
.dc-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed #e5e9f0; }
.dc-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.dc-col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; min-width: 0; }
.dc-bar { width: 100%; background: #0ea5e9; border-radius: 4px 4px 0 0; }
.dc-col.on .dc-bar { background: #0369a1; }
.dc-tip { position: absolute; top: 4px; left: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow); pointer-events: none; }
.dc-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.sidebar .nav-grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(199, 210, 254, .5); padding: 12px 22px 4px; }

.bar-row.br-wide { grid-template-columns: minmax(140px, 1fr) 3fr minmax(110px, auto); padding: 6px 0; }
.bar-row .bf.negf { background: var(--red); }

.qr-box { width: 160px; flex: none; background: #fff; border-radius: 10px; padding: 4px; }
.qr-box svg { width: 100%; height: auto; display: block; }
.backup-list { max-height: 360px; overflow-y: auto; }

.onboard { max-width: 760px; margin: 0 auto; }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.ind-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font-size: 13px; text-align: center; }
.ind-card .ii { font-size: 26px; }
.ind-card.on { border-color: var(--primary); background: var(--primary-2); font-weight: 600; }

.pos-promo { position: absolute; top: 12px; right: 44px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; z-index: 1; }

/* ---------- Kassa uskunalari ---------- */
.hw-status { display: none !important; }
.kbd { display: inline-block; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; font-size: 10.5px; background: var(--surface-2); }
.change-box { display: flex; justify-content: space-between; align-items: center; background: var(--green-bg); color: var(--green); border-radius: 10px; padding: 8px 12px; font-size: 15px; }
.change-box b { font-size: 22px; }
.pos-line.flash { animation: posflash 1.2s ease-out; }
@keyframes posflash { 0% { background: #bae6fd; } 100% { background: transparent; } }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.mode-card { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; font-size: 13px; }
.mode-card .mi { font-size: 20px; }
.mode-card.on { border-color: var(--primary); background: var(--primary-2); }
.scan-test { border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; min-height: 90px; background: var(--surface-2); }
.tips { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.tips ul { margin: 6px 0 0; padding-left: 18px; }

.shift-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }

.doc.akt tr.b td { font-weight: 700; background: #f8fafc; }

.print-only { display: none; }
@media print { .print-only { display: inline; } .no-print-input, .print-area .money-input, .print-area input { display: none !important; } }

.bonus-row { display: flex; align-items: center; gap: 8px; background: var(--amber-bg); border-radius: 10px; padding: 6px 10px; font-size: 13px; }

.sidebar .att { font-size: 12px; margin: 4px 0; display: flex; align-items: center; gap: 6px; color: #bae6fd; }
.sidebar .att a { color: #7dd3fc; }

/* ---------- Mahsulot rasmi yuklash (Kamera / Galereya) ---------- */
.prod-img-zone {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  transition: all .2s;
}
.prod-img-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.prod-img-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  flex-shrink: 0;
}
.prod-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prod-img-opt-wrap {
  position: relative;
  display: inline-block;
}
.prod-img-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.15);
  min-width: 220px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.prod-img-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  width: 100%;
  transition: background .15s;
}
.prod-img-opt:hover {
  background: var(--surface-2);
}
.prod-img-opt .opt-ico {
  font-size: 22px;
  line-height: 1;
}
.prod-img-opt .opt-title {
  font-weight: 600;
  font-size: 13.5px;
}
.prod-img-opt .opt-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* Mahsulot ko'rish sahifasi (ProductView) rasm va asosiy ma'lumotlar */
.prod-view-header-card {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.prod-view-header {
  display: flex;
  gap: 20px;
  align-items: center;
}
.prod-view-img-wrap {
  width: 130px;
  height: 130px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
  padding: 6px;
  box-sizing: border-box;
}
.prod-view-img-wrap:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.prod-view-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.prod-view-noimg {
  font-size: 44px;
  line-height: 1;
  opacity: 0.6;
}
.prod-view-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prod-view-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.prod-view-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.prod-view-code {
  font-size: 13.5px;
  color: var(--muted);
}
.prod-view-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.prod-view-badges .badge {
  font-size: 12.5px;
  padding: 4px 10px;
  font-weight: 600;
}

/* Do'kon 1 va Do'kon 2 belgilari */
.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(109, 40, 217, 0.09);
  color: #6d28d9;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(109, 40, 217, 0.18);
}
.pos-reg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.pos-reg select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--primary);
  outline: none;
  cursor: pointer;
}

/* ---- Qo'shnilar bilan oldi-berdi (Partner Loans UI) ---- */
.partner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.partner-header-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.partner-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-partner-give {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border: 1px solid #0369a1 !important;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 16px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  transition: all .15s ease;
  cursor: pointer;
}
.btn-partner-give:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
  filter: brightness(1.05);
}
.btn-partner-take {
  background: linear-gradient(135deg, #059669, #047857) !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 16px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all .15s ease;
  cursor: pointer;
}
.btn-partner-take:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
  filter: brightness(1.05);
}

/* Metric / Stat cards */
.partner-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.partner-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.partner-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.partner-stat-card.stat-give {
  border-top: 4px solid #ef4444;
}
.partner-stat-card.stat-take {
  border-top: 4px solid #10b981;
}
.partner-stat-card.stat-active {
  border-top: 4px solid #0ea5e9;
}
.partner-stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.partner-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.partner-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.stat-give .partner-stat-icon { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stat-take .partner-stat-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-active .partner-stat-icon { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; }
.partner-stat-val {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-give .partner-stat-val { color: #dc2626; }
.stat-take .partner-stat-val { color: #059669; }
.stat-active .partner-stat-val { color: #0284c7; }
.partner-stat-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Filter toolbar */
.partner-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.partner-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.partner-tab-btn {
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  outline: none;
  text-decoration: none;
}
.partner-tab-btn .partner-tab-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform .2s ease;
}
.partner-tab-btn .partner-tab-text {
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.partner-tab-btn .partner-tab-count {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
  min-width: 20px;
  text-align: center;
  transition: all .2s ease;
}
.partner-tab-btn:hover .partner-tab-icon {
  transform: scale(1.18);
}
.partner-tab-btn:active {
  transform: scale(0.97);
}

/* 1. Qo'shniga berilganlar (Red / Coral) */
.partner-tab-btn.tab-give {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.08);
}
.partner-tab-btn.tab-give .partner-tab-count {
  background: #fee2e2;
  color: #b91c1c;
}
.partner-tab-btn.tab-give:hover {
  background: #fee2e2;
  border-color: #f87171;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}
.partner-tab-btn.tab-give.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.38) !important;
}
.partner-tab-btn.tab-give.active .partner-tab-count {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

/* 2. Qo'shnidan olinganlar (Green / Emerald) */
.partner-tab-btn.tab-take {
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #059669;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.08);
}
.partner-tab-btn.tab-take .partner-tab-count {
  background: #d1fae5;
  color: #047857;
}
.partner-tab-btn.tab-take:hover {
  background: #d1fae5;
  border-color: #34d399;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.18);
}
.partner-tab-btn.tab-take.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.38) !important;
}
.partner-tab-btn.tab-take.active .partner-tab-count {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

/* 3. Yopilganlar tarixi (Indigo / Violet) */
.partner-tab-btn.tab-closed {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.08);
}
.partner-tab-btn.tab-closed .partner-tab-count {
  background: #e0f2fe;
  color: #0369a1;
}
.partner-tab-btn.tab-closed:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
}
.partner-tab-btn.tab-closed.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.38) !important;
}
.partner-tab-btn.tab-closed.active .partner-tab-count {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

/* 4. Barchasi (Slate / Neutral) */
.partner-tab-btn.tab-all {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.partner-tab-btn.tab-all .partner-tab-count {
  background: #e2e8f0;
  color: #334155;
}
.partner-tab-btn.tab-all:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}
.partner-tab-btn.tab-all.active {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
  border-color: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.35) !important;
}
.partner-tab-btn.tab-all.active .partner-tab-count {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

/* Loan card (Document) */
.partner-loan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.partner-loan-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
.partner-loan-card.type-give {
  border-left: 5px solid #ef4444;
}
.partner-loan-card.type-take {
  border-left: 5px solid #10b981;
}

.loan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.loan-card-partner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.loan-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.loan-card-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.loan-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.loan-badge-give {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.loan-badge-take {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.loan-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}
.loan-note-pill {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  padding: 2px 8px;
  border-radius: 6px;
  font-style: italic;
  color: var(--text);
}

.loan-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-loan-akt {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}
.btn-loan-akt:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-2);
}
.btn-loan-del {
  background: transparent;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.btn-loan-del:hover {
  background: #fee2e2;
}

/* Row Action Buttons */
.loan-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.btn-action-return {
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-action-return:hover {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}
.btn-action-pay {
  background: #f0f9ff;
  color: #075985;
  border: 1.5px solid #bae6fd;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-action-pay:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

/* Selection Cards in New Modal */
.type-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.type-select-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: all .15s ease;
}
.type-select-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}
.type-select-card.selected-give {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.04);
}
.type-select-card.selected-take {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.04);
}
.type-select-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.selected-give .type-select-title { color: #dc2626; }
.selected-take .type-select-title { color: #059669; }
.type-select-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Dark theme overrides for partner loans */
body.dark-theme .btn-partner-give {
  background: #0284c7 !important;
  color: #fff !important;
}
body.dark-theme .btn-partner-take {
  background: #059669 !important;
  color: #fff !important;
}
body.dark-theme .partner-stat-card {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-theme .stat-give .partner-stat-val { color: #f87171; }
body.dark-theme .stat-take .partner-stat-val { color: #34d47a; }
body.dark-theme .stat-active .partner-stat-val { color: #38bdf8; }
body.dark-theme .partner-toolbar {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-theme .partner-tab-btn.tab-give {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
body.dark-theme .partner-tab-btn.tab-give .partner-tab-count {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
body.dark-theme .partner-tab-btn.tab-give:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
}
body.dark-theme .partner-tab-btn.tab-give.active {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45) !important;
}

body.dark-theme .partner-tab-btn.tab-take {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
body.dark-theme .partner-tab-btn.tab-take .partner-tab-count {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
body.dark-theme .partner-tab-btn.tab-take:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
}
body.dark-theme .partner-tab-btn.tab-take.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
}

body.dark-theme .partner-tab-btn.tab-closed {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
  color: #7dd3fc;
}
body.dark-theme .partner-tab-btn.tab-closed .partner-tab-count {
  background: rgba(14, 165, 233, 0.25);
  color: #7dd3fc;
}
body.dark-theme .partner-tab-btn.tab-closed:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: #38bdf8;
}
body.dark-theme .partner-tab-btn.tab-closed.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45) !important;
}

body.dark-theme .partner-tab-btn.tab-all {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
body.dark-theme .partner-tab-btn.tab-all .partner-tab-count {
  background: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}
body.dark-theme .partner-tab-btn.tab-all:hover {
  background: rgba(148, 163, 184, 0.2);
  border-color: #cbd5e1;
}
body.dark-theme .partner-tab-btn.tab-all.active {
  background: linear-gradient(135deg, #475569 0%, #334155 100%) !important;
  border-color: #94a3b8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}
body.dark-theme .partner-loan-card {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-theme .btn-action-return {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
body.dark-theme .btn-action-pay {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border-color: rgba(14, 165, 233, 0.3);
}
body.dark-theme .btn-loan-akt {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
body.dark-theme .loan-badge-give {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
body.dark-theme .loan-badge-take {
  background: rgba(16, 185, 129, 0.2);
  color: #86efac;
  border-color: rgba(16, 185, 129, 0.3);
}
body.dark-theme .type-select-card {
  background: var(--surface-2);
  border-color: var(--border);
}



/* ================= Dizayn tuzatishlari (2.0.1) ================= */
/* Yon menyu: pastda gorizontal aylantirish chizig'i chiqmasin, uzun nomlar chiroyli qatorlansin */
.sidebar { overflow-x: hidden; }
.sidebar nav a { line-height: 1.3; }
.sidebar nav a > span:not(.ico):not(.badge) { min-width: 0; overflow-wrap: anywhere; }
.sidebar nav .ico { flex-shrink: 0; display: inline-flex; justify-content: center; }
.sidebar nav .ico svg { width: 18px; height: 18px; }

/* Kassa kartasi: "TUGADI" belgisi karta chetidan chiqib, sahifani yon tomonga surmasin */
.pos-tile { min-width: 0; overflow: hidden; }
.pos-card-head { min-width: 0; }
.pos-card-head .badge { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; padding: 1px 6px; }
.pos-card-code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 767px) {
  /* Telefonda rasm kichikroq — bir ekranda ko'proq tovar ko'rinadi */
  .pos-card-img { min-height: 0; max-height: 120px; }
  .pos-no-img { font-size: 34px; }
  .pos-price-row { font-size: 11px; }
  .pos-price-row.highlight .pos-price-val { font-size: 12.5px; }
}

/* Mahsulotlar ro'yxati telefonda: ixcham kartochka (rasm chapda, nom/narx/qoldiq o'ngda) */
@media (max-width: 820px) {
  table.prod-table tr {
    display: grid; grid-template-columns: 26px 52px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; align-items: center;
    grid-template-areas: "chk img name name" "chk img price stock" "chk img code box";
    position: relative; padding: 12px; margin: 0 0 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  }
  table.prod-table td { padding: 0 !important; width: auto !important; min-height: 0; text-align: left; }
  table.prod-table td::before { content: none !important; }
  table.prod-table .pt-chk { grid-area: chk; align-self: center; }
  table.prod-table .pt-img { grid-area: img; align-self: start; }
  table.prod-table .pt-name { grid-area: name; font-size: 14px; padding-right: 34px !important; }
  table.prod-table .pt-edit { position: absolute; top: 8px; right: 8px; }
  table.prod-table .pt-price { grid-area: price; }
  table.prod-table .pt-stock { grid-area: stock; text-align: right; }
  table.prod-table .pt-code { grid-area: code; }
  table.prod-table .pt-box { grid-area: box; text-align: right; font-size: 12px; }
  table.prod-table .pt-cost { display: none; }
  table.prod-table .pt-img img, table.prod-table .pt-img .prod-thumb-empty { width: 52px; height: 52px; }
}

/* =====================================================================
   PROFESSIONAL DIZAYN (2.1) — yagona dizayn tizimi
   Mavzu presetlari (lib.js: --primary, --sidebar-bg, --topbar-bg) va qorong'u rejim saqlanadi.
   Faqat ko'rinish: klasslar va HTML o'zgarmagan.
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e6e8ec;
  --border-strong: #d4d8df;
  --text: #0f172a;
  --muted: #667085;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .25);
  --ring: color-mix(in srgb, var(--primary) 22%, transparent);
  --primary-soft: color-mix(in srgb, var(--primary) 9%, transparent);
  --sidebar: 244px;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.dark-theme { --border-strong: #475569; --bg: #0b1220; --surface: #131c2e; --surface-2: #1b2539; --border: #26324a; }
body { line-height: 1.45; letter-spacing: -.003em; }
::selection { background: var(--ring); }

/* ---------- Tipografiya ---------- */
h1, .page-head h1 { font-family: inherit; font-size: 24px; font-weight: 700; letter-spacing: -.022em; line-height: 1.2; color: var(--text); }
h2 { font-family: inherit; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 14.5px; font-weight: 650; }
.modal .mh h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
a { color: var(--primary); }

/* ---------- Yon menyu ---------- */
.sidebar { width: var(--sidebar); border-right: 1px solid rgba(255, 255, 255, .06); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 6px; }
.sidebar .brand { padding: 22px 18px 14px; border-bottom: 0; margin-bottom: 4px; }
.sidebar .brand .brand-logo { width: 150px; }
.sidebar .branch-name { margin: 0 12px 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .09); color: #fff; font-size: 13px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .08); }
.sidebar .back-branches { margin: 0 14px 10px; font-size: 12.5px; color: rgba(255, 255, 255, .62); }
.sidebar .back-branches:hover { color: #fff; }
.sidebar .nav-grp { padding: 16px 22px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; color: rgba(255, 255, 255, .42); }
.sidebar nav a {
  margin: 1px 10px; padding: 8px 12px; border-radius: 8px; gap: 11px;
  color: rgba(255, 255, 255, .74); font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.sidebar nav a.active::before { display: block; content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #fff; }
.sidebar nav .ico { color: currentColor; opacity: .75; }
.sidebar nav a.active .ico, .sidebar nav a:hover .ico { opacity: 1; color: #fff; }
.sidebar .badge { background: #f43f5e; color: #fff; font-size: 11px; padding: 1px 7px; min-width: 20px; text-align: center; }
.sidebar .user { padding: 14px 18px 16px; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .7); }
.sidebar .user a { color: rgba(255, 255, 255, .85); }
.sidebar .att { color: rgba(255, 255, 255, .7); }

/* ---------- Ustki panel (telefon/planshet) ---------- */
.topbar { min-height: 54px; padding: 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.topbar .t { font-family: inherit; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }

/* ---------- Asosiy maydon ---------- */
.main { padding: 26px 32px 64px; }
.page-head { margin-bottom: 20px; gap: 10px; }
@media (max-width: 1100px) { .main { padding: 16px 14px 84px; } h1, .page-head h1 { font-size: 21px; } }

/* Dastur ichidagi tasdiq oynasi: variantlar */
.ask-choice { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; }
.ask-choice.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.ask-choice input { margin-top: 3px; width: auto; flex: none; }
.ask-choice > span { flex: 1; text-align: left; }

/* Sahifa sarlavhasi — qotirilgan (aylantirganda tepada qoladi), butun kenglikda, shaffof-xira fon */
.page-head {
  position: sticky; top: 0; z-index: 25;
  margin: -26px -32px 20px; padding: 14px 32px; min-height: 66px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px -14px rgba(15, 23, 42, .35);
}
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1::before {
  content: ""; width: 4px; height: 22px; border-radius: 4px; flex: none;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 45%, #fff));
}
.page-head .btn { box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
@media (max-width: 1100px) {
  .topbar { height: 56px; min-height: 56px; overflow: hidden; }
  .page-head {
    top: 56px; margin: -16px -14px 14px; padding: 10px 14px; min-height: 0;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  }
  .page-head::-webkit-scrollbar { display: none; }
  .page-head h1 { white-space: nowrap; }
  .page-head h1::before { height: 18px; }
  .page-head > * { flex-shrink: 0; }
}

/* ---------- Kartalar ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { gap: 16px; }
.card h2 { margin-bottom: 14px; }
.stat { padding: 16px 18px; }
.stat .l { font-size: 12.5px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; line-height: 1.15; }
.stat .s { font-size: 12.5px; margin-top: 4px; }
@media (max-width: 700px) { .stat { padding: 13px 14px; } .stat .v { font-size: 18px; } }

/* ---------- Tugmalar ---------- */
.btn {
  min-height: 36px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s, box-shadow .12s, filter .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--primary); filter: brightness(.94); }
.btn.green { background: #059669; border-color: #059669; color: #fff; }
.btn.green:hover { background: #047857; border-color: #047857; }
.btn.red { border-color: #fecaca; color: #dc2626; }
.btn.red:hover { background: #fef2f2; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; }
.btn.icon { min-width: 36px; padding: 6px 9px; }
.btn:disabled { opacity: .5; filter: none; }

/* ---------- Formalar ---------- */
input, select, textarea {
  min-height: 38px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--primary); }
input[type="color"] { padding: 3px; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:hover, select:hover, textarea:hover { border-color: #b9c0cb; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
label.f > span { font-size: 12.5px; font-weight: 600; color: #344054; margin-bottom: 6px; }
body.dark-theme label.f > span { color: var(--muted); }
.form-grid { gap: 14px 16px; }
.search-big input { min-height: 42px; padding: 10px 14px 10px 40px; font-size: 14.5px; border-radius: 10px; }
.search-big::before { left: 14px; font-size: 13px; opacity: .5; }

/* ---------- Chiplar va tablar ---------- */
.chip { min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 500; transition: background .12s, border-color .12s; }
.chip:hover { border-color: #b9c0cb; background: var(--surface-2); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.tabs { gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 12px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- Belgilar (badge) ---------- */
.badge { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.badge.green { background: #ecfdf3; color: #067647; box-shadow: inset 0 0 0 1px #abefc6; }
.badge.red { background: #fef3f2; color: #b42318; box-shadow: inset 0 0 0 1px #fecdca; }
.badge.amber { background: #fffaeb; color: #b54708; box-shadow: inset 0 0 0 1px #fedf89; }
.badge.blue { background: #eff8ff; color: #175cd3; box-shadow: inset 0 0 0 1px #b2ddff; }
.badge.gray { background: #f2f4f7; color: #344054; box-shadow: inset 0 0 0 1px #e4e7ec; }
.badge.purple { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--ring); }
body.dark-theme .badge { box-shadow: none; }

/* ---------- Jadvallar ---------- */
.card.p0 { padding: 0; overflow: hidden; overflow-x: auto; }
table.t th {
  padding: 11px 14px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .045em; border-bottom: 1px solid var(--border);
}
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
table.t tbody tr { transition: background .1s; }
table.t tr.click:hover td { background: var(--primary-soft); }
table.t tfoot td { background: var(--surface-2); border-top: 1px solid var(--border); }
@media (max-width: 820px) {
  table.rt tr { padding: 12px 14px; }
  table.rt td { padding-top: 4px; padding-bottom: 4px; }
}
.empty { padding: 48px 20px; color: var(--muted); font-size: 14px; }

/* ---------- Modal, toast, ro'yxatlar ---------- */
.modal-bg { background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal { border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.modal .mh { padding: 18px 22px; }
.modal .mb { padding: 20px 22px; }
.modal .mf { padding: 14px 22px; background: var(--surface-2); }
@media (max-width: 600px) { .modal { border-radius: 0; border: 0; } }
.toast { border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-lg); font-weight: 500; }
.ac-list { border-radius: 12px; border-color: var(--border); box-shadow: var(--shadow-lg); padding: 4px; }
.ac-item { border-radius: 8px; }
.result-box { border-radius: var(--radius-sm); }
.warn-box { border-radius: var(--radius-sm); }
.prod-thumb { border-radius: 8px; object-fit: contain; background: #fff; }
body.dark-theme .prod-thumb { background: var(--surface-2); }

/* ---------- Kassa (POS) ---------- */
.pos-wrap { gap: 18px; }
.pos-tools { padding: 2px 0 10px; gap: 8px; }
.pos-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.pos-tile { border-radius: 14px; padding: 10px; gap: 7px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.pos-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--shadow-md); }
.pos-tile.pos-out { border: 1px solid #fecdca; background: var(--surface); }
.pos-tile.pos-out .pos-card-img { opacity: .55; }
.pos-card-img { aspect-ratio: 4 / 3; min-height: 0; max-height: none; border: 0; border-radius: 10px; background: var(--surface-2); padding: 8px; }
.pos-card-img img { mix-blend-mode: multiply; }
body.dark-theme .pos-card-img img { mix-blend-mode: normal; }
.pos-card-name { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.pos-card-code { font-size: 10.5px; font-weight: 600; color: var(--muted); background: transparent; border: 0; padding: 0; }
.pos-card-box { font-size: 11px; background: transparent; border: 0; padding: 0; color: var(--muted); }
.pos-card-prices { background: transparent; border: 0; padding: 0; gap: 1px; }
.pos-price-row.highlight .pos-price-val { color: var(--text); font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.pos-card-stock { border-radius: 6px; font-size: 11px; font-weight: 600; padding: 3px 6px; }
.pos-card-stock.stock-ok { background: #ecfdf3; color: #067647; border: 0; }
.pos-card-stock.stock-low { background: #fffaeb; color: #b54708; border: 0; }
.pos-info { top: 15px; right: 15px; width: 24px; height: 24px; font-size: 12px; border-color: var(--border); box-shadow: var(--shadow); }
.pos-in { top: 15px; left: 15px; background: var(--primary); }
.pos-cart { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-md); overflow-x: hidden; overflow-y: auto; }   /* surilsin — pastdagi tugma kesilmasin */
.pos-sec { padding: 14px 16px; }
.pos-actions { padding: 14px 16px; }
.pos-go { min-height: 48px; border-radius: 10px; font-size: 15px; font-weight: 700; letter-spacing: 0; box-shadow: 0 6px 16px -6px var(--primary) !important; }
.pos-li { border-radius: 12px; }
.pos-branch-badge { border-radius: var(--radius-sm); min-height: 36px; font-weight: 600; }
@media (max-width: 767px) {
  .pos-grid { gap: 10px; }
  .pos-card-img { aspect-ratio: 4 / 3; max-height: none; }
  .pos-price-row.highlight .pos-price-val { font-size: 13px; }
}

/* ---------- Kirish sahifasi ---------- */
.login-wrap .card { border-radius: 18px; padding: 26px; }
.login-wrap .btn.primary { min-height: 46px; font-size: 15px; }

/* ---------- Egasi paneli ---------- */
.branch-card { border-top: 0; box-shadow: var(--shadow); }
.branch-card:hover { box-shadow: var(--shadow-md); }
.notice-gold { border-radius: var(--radius-sm); }

@media print {
  .card, .modal { box-shadow: none !important; }
}
/* Kassa ustki qatori: "Donalab / Qadoqlab" tugmasi siqilib yo'qolmasin */
.pos-tools .unit-toggle { flex-shrink: 0; border-radius: var(--radius-sm); border-color: var(--border-strong); }
.pos-tools .unit-toggle button { white-space: nowrap; }
.pos-tools .pos-reg, .pos-tools > .row > .btn { flex-shrink: 0; }
@media (min-width: 768px) {
  .pos-tools > .row:first-child { flex-wrap: wrap !important; row-gap: 8px; }
  .pos-tools .search-big { flex: 1 1 240px; min-width: 200px; }
}
/* Mahsulotlar ro'yxati: holat ranglari (yorug' va qorong'u rejimda ham o'qiladi) */
table.t tr.row-selected td { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
table.t tr.row-out td { background: color-mix(in srgb, #ef4444 6%, var(--surface)); }
table.t tr.row-low td { background: color-mix(in srgb, #f59e0b 7%, var(--surface)); }
@media (max-width: 820px) {
  table.prod-table tr.row-out { background: color-mix(in srgb, #ef4444 6%, var(--surface)); }
  table.prod-table tr.row-low { background: color-mix(in srgb, #f59e0b 7%, var(--surface)); }
  table.prod-table tr.row-selected { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
  table.prod-table tr td { background: transparent !important; }
}

/* ---------- Yagona semantik palitra (sahifalardagi ranglar shu yerdan olinadi) ---------- */
:root {
  --green: #079455; --green-bg: #ecfdf3; --green-bd: #abefc6;
  --red: #d92d20;   --red-bg: #fef3f2;   --red-bd: #fecdca;
  --amber: #dc6803; --amber-bg: #fffaeb; --amber-bd: #fedf89;
  --blue: #1570ef;  --blue-bg: #eff8ff;  --blue-bd: #b2ddff;
}
body.dark-theme {
  --green: #47cd89; --green-bg: rgba(71, 205, 137, .12); --green-bd: rgba(71, 205, 137, .35);
  --red: #f97066;   --red-bg: rgba(249, 112, 102, .12);  --red-bd: rgba(249, 112, 102, .35);
  --amber: #fdb022; --amber-bg: rgba(253, 176, 34, .12); --amber-bd: rgba(253, 176, 34, .35);
  --blue: #53b1fd;  --blue-bg: rgba(83, 177, 253, .12);  --blue-bd: rgba(83, 177, 253, .35);
}
.badge.green { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px var(--green-bd); }
.badge.red { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px var(--red-bd); }
.badge.amber { background: var(--amber-bg); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber-bd); }
.badge.blue { background: var(--blue-bg); color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue-bd); }
.pos-card-stock.stock-ok { background: var(--green-bg); color: var(--green); }
.pos-card-stock.stock-low { background: var(--amber-bg); color: var(--amber); }
.pos-tile.pos-out { border-color: var(--red-bd); }
.btn.red { border-color: var(--red-bd); color: var(--red); }
.btn.red:hover { background: var(--red-bg); }
.btn.green { background: var(--green); border-color: var(--green); }
body.dark-theme .btn.green { color: #06281a; }

/* ---------- Qo'shnilar (oldi-berdi): umumiy uslubga moslash ---------- */
.btn-partner-give { background: var(--primary) !important; border: 1px solid var(--primary) !important; color: #fff !important; box-shadow: 0 1px 2px rgba(16,24,40,.12) !important; }
.btn-partner-take { background: var(--surface) !important; border: 1px solid var(--border-strong) !important; color: var(--text) !important; box-shadow: var(--shadow) !important; }
.btn-partner-give:hover { filter: brightness(.94); transform: none !important; }
.btn-partner-take:hover { background: var(--surface-2) !important; transform: none !important; }
.partner-stat-card { border: 1px solid var(--border) !important; border-top: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; }
.partner-stat-card:hover { transform: none !important; box-shadow: var(--shadow-md) !important; }
.stat-give .partner-stat-icon { background: var(--red-bg); color: var(--red); }
.stat-take .partner-stat-icon { background: var(--green-bg); color: var(--green); }
.stat-active .partner-stat-icon { background: var(--primary-soft); color: var(--primary); }
.stat-give .partner-stat-val { color: var(--red); }
.stat-take .partner-stat-val { color: var(--green); }
.stat-active .partner-stat-val { color: var(--text); }
.partner-tab-btn, .partner-tab-btn.tab-give, .partner-tab-btn.tab-take, .partner-tab-btn.tab-closed, .partner-tab-btn.tab-all {
  background: var(--surface) !important; border: 1px solid var(--border-strong) !important; color: var(--text) !important;
  box-shadow: none !important; transform: none !important; border-radius: var(--radius-sm) !important;
}
.partner-tab-btn:hover { background: var(--surface-2) !important; }
.partner-tab-btn.active, .partner-tab-btn.tab-give.active, .partner-tab-btn.tab-take.active, .partner-tab-btn.tab-closed.active, .partner-tab-btn.tab-all.active {
  background: var(--primary-soft) !important; border-color: var(--primary) !important; color: var(--primary) !important; font-weight: 600;
}
.partner-tab-btn .partner-tab-count, .partner-tab-btn.active .partner-tab-count { background: var(--surface-2) !important; color: var(--muted) !important; box-shadow: inset 0 0 0 1px var(--border); }
.partner-tab-btn.active .partner-tab-count { background: var(--primary) !important; color: #fff !important; box-shadow: none; }

/* ---------- Indigo qoldiqlari → brend rangi (mavzu bilan birga o'zgaradi) ---------- */
.reg-cash { background: var(--topbar-bg, #0c4a6e); color: #fff; border-radius: 10px; }
.reg-cash .muted, .reg-cash small { color: rgba(255, 255, 255, .7); }
.reg-cash .v { font-family: inherit; letter-spacing: -.02em; }
.rc-bar > div, .bar-row .bf { background: var(--primary); }
.dc-bar { background: color-mix(in srgb, var(--primary) 70%, #fff); }
.dc-col.on .dc-bar, .dc-bar:hover { background: var(--primary); }
.notice-gold { background: var(--primary-soft) !important; border-color: var(--ring) !important; color: var(--text); }
.notice-gold b { color: var(--primary); }
.role-card.system { background: var(--surface); box-shadow: inset 0 3px 0 var(--primary), var(--shadow); }
.branch-card { border-top: 0; }
.login-wrap { background: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 55%, #0c4a6e) 0%, var(--topbar-bg, #0c4a6e) 50%, #082f49 100%); }
.login-foot { color: rgba(255, 255, 255, .6); }
.owner-top .lang-sw button, .owner-top a { color: rgba(255, 255, 255, .75); }
.owner-me .muted { color: rgba(255, 255, 255, .65); }
.sidebar .att, .sidebar .att a { color: rgba(255, 255, 255, .72); }
@keyframes posflash { 0% { background: var(--primary-soft); } 100% { background: transparent; } }

/* ---------- Retsept (komplekt tarkibi) ---------- */
.recipe-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.recipe-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 48px 36px; gap: 8px; align-items: center; margin-bottom: 6px; }
.recipe-unit { text-align: left; }
@media (max-width: 600px) { .recipe-row { grid-template-columns: minmax(0, 1fr) 80px 36px; } .recipe-unit { display: none; } }
.unit-toggle { flex-wrap: wrap; }
/* ---------- Variantlar jadvali ---------- */
.variant-table { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 4px; }
.variant-table table.t td { padding: 6px 10px; }
.variant-table input { min-height: 32px; padding: 5px 8px; max-width: 200px; }
.variant-table .row { padding: 0 10px; }
/* ---------- Offline kassa ---------- */
.offline-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--radius-sm);
  background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); font-size: 13.5px; font-weight: 500; }
.offline-list { margin-bottom: 12px; padding: 8px 14px; }
.offline-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.offline-row:last-child { border-bottom: 0; }

/* ===== Nakladnoy / KP: to'rtburchaklar tepada, rekvizitlar pastda, nom ustuni torroq, rasm kattaroq ===== */
.doc .parties.doc-top { margin: 0 0 8px; }
.doc .parties .p { position: relative; }
.doc .doc-mini-logo { position: absolute; top: 5px; right: 6px; height: 26px; width: auto; max-width: 90px; display: inline-flex; }
.doc .doc-mini-logo svg, .doc .doc-mini-logo img { height: 26px; width: auto; max-width: 90px; display: block; }
.doc h1 { margin: 2px 0 1px; }
.doc .doc-sub { margin-bottom: 8px; }
.doc .doc-foot { border-bottom: 0; border-top: 1px solid #000; padding: 6px 0 0; margin: 10px 0 0; font-size: 11.5px; }
.doc .doc-foot .doc-logo { display: none; }
/* Ixcham sarlavha: bitta katak (sotuvchi · INN · raqam · sana / mijoz) — ma'lumotlar qator bo'ylab, kam joy */
.doc .doc-box { display: flex; align-items: center; gap: 10px; border: 1px solid #000; padding: 5px 8px; margin: 0 0 6px; font-size: 11.5px; line-height: 1.45; }
.doc .doc-box-logo { height: 26px; width: auto; max-width: 90px; display: inline-flex; flex: 0 0 auto; }
.doc .doc-box-logo svg, .doc .doc-box-logo img { height: 26px; width: auto; max-width: 90px; display: block; }
.doc .doc-box-lines { flex: 1; min-width: 0; }
.doc .doc-box .ln > span + span::before { content: '·'; margin: 0 6px; color: #666; font-weight: 400; }
.doc .doc-box + h1 { margin: 4px 0 6px; }
.doc table th.doc-name-col { width: 26%; }
.doc .doc-name { font-weight: 700; font-size: 12px; line-height: 1.25; word-break: break-word; }
.doc-prod-img { width: 84px; height: 84px; }
@media print {
  .doc-prod-img { width: 84px !important; height: 84px !important; }
}

/* To'lov oynasi: hujjat tanlash (raqam, sana, summa, to'langan, qoldiq) */
.doc-pick { display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.doc-pick-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; text-align: left; padding: 8px 10px; border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--surface, #fff); color: inherit; cursor: pointer; font: inherit; font-size: 13px; }
.doc-pick-row:hover { border-color: var(--brand, #d94680); }
.doc-pick-row.on { border-color: var(--brand, #d94680); background: var(--brand-bg, #fdf2f7); box-shadow: 0 0 0 2px var(--brand-bg, #fdf2f7); }
.doc-pick-row .neg { color: var(--red, #dc2626); }

/* Nakladnoy / KP rasmsiz (sukut): bir A4 varaqqa ~30 tovar (qator 7 mm, o'qishga qulay shrift) */
.doc table.compact th, .doc table.compact td { padding: 1px 5px; font-size: 12px; line-height: 1.25; }
.doc table.compact tbody td { height: 7mm; }
.doc table.compact .doc-name { font-size: 12px; font-weight: 600; line-height: 1.25; }
.doc table.compact td[style*="monospace"] { font-size: 10px !important; }
.doc .doc-color-inline { font-weight: 400; color: #333; }
@media print { .doc table.compact th, .doc table.compact td { padding: 1px 4px !important; } }
.doc table.compact td[style*="monospace"] { white-space: nowrap; }

/* Ustunlar foizda — har qanday kenglikda (ekran, chop etish, PDF) sig'adi; "Nomi" torroq, "Summa" to'liq */
.doc table.items .doc-name { overflow-wrap: anywhere; }
/* PDF: varaqda 11 mm hoshiya bor — hujjat 188 mm ga moslanadi (o'ng tomoni kesilmasin) */
.doc.pdf-mode { width: 188mm !important; min-height: 0 !important; padding: 0 !important; box-shadow: none !important; margin: 0 !important; }

/* Kassa paneli: bo'limlar yig'iladi / ochiladi, tovarlar ro'yxati o'z ichida suriladi va balandligi tortib o'zgartiriladi */
.pos-cart-in { min-height: 100%; }
.pos-actions { margin-top: auto; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.sec-head > b::before { content: '▾'; display: inline-block; width: 14px; color: var(--muted); transition: transform .12s; }
.sec-head.folded > b::before { transform: rotate(-90deg); }
.sec-sum { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pos-lines { overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.pos-resize { height: 14px; margin: 4px -14px -10px; cursor: ns-resize; display: flex; align-items: center; justify-content: center; touch-action: none; }
.pos-resize::before { content: ''; width: 46px; height: 5px; border-radius: 4px; background: var(--border); }
.pos-resize:hover::before, .pos-resize.on::before { background: var(--primary); }
/* Kassa: pulning qismlari boshqa kartalarga */
.card-parts { margin-top: 8px; display: grid; gap: 6px; }
.card-part { padding: 6px 8px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 8px; }
/* Nakladnoy / KP: "Jami" faqat jadval oxirida (oxirgi varaqda) — har varaqda takrorlanmaydi; ustun nomlari takrorlanadi */
.doc table tfoot { display: table-row-group; }
.doc table.items tfoot tr { page-break-inside: avoid; break-inside: avoid; }
/* Kassa: tugagan tovar tanlanmaydi */
.pos-tile.pos-out { cursor: not-allowed; }
.pos-tile.pos-out .pos-card-img, .pos-tile.pos-out .pos-card-name { opacity: .5; }
/* Xarid (kirim): tannarx yashirilganda — faqat tovar, karobka/dona, soni */
.items-ed .it.pur.simple { grid-template-columns: minmax(220px, 3fr) 200px 140px 34px; }
@media (max-width: 760px) { .items-ed .it.pur.simple { grid-template-columns: 1fr 1fr; } }
/* Nakladnoy / KP: miqdor ostida necha karobka va karobkada nechtadan */
.doc .doc-box-info { font-size: 9px; color: #555; line-height: 1; white-space: nowrap; margin-top: 1px; }
.doc table.compact td:has(.doc-box-info) { line-height: 1.05; padding-top: 0; padding-bottom: 0; }

/* Ustunlar (Karobka ustuni bilan): № | Nomi | Kodi | Karobka | Miqdor | Narxi | Summa */
.doc table.items.compact thead th:nth-child(1) { width: 5% !important; }
.doc table.items.compact thead th:nth-child(2) { width: 26% !important; }
.doc table.items.compact thead th:nth-child(3) { width: 13% !important; }
.doc table.items.compact thead th:nth-child(4) { width: 17% !important; }
.doc table.items.compact thead th:nth-child(5) { width: 10% !important; }
.doc table.items.compact thead th:nth-child(6) { width: 13% !important; }
.doc table.items.compact thead th:nth-child(7) { width: 16% !important; }
.doc table.items:not(.compact) thead th:nth-child(1) { width: 4% !important; }
.doc table.items:not(.compact) thead th:nth-child(2) { width: 12% !important; }
.doc table.items:not(.compact) thead th:nth-child(3) { width: 19% !important; }
.doc table.items:not(.compact) thead th:nth-child(4) { width: 11% !important; }
.doc table.items:not(.compact) thead th:nth-child(5) { width: 15% !important; }
.doc table.items:not(.compact) thead th:nth-child(6) { width: 10% !important; }
.doc table.items:not(.compact) thead th:nth-child(7) { width: 13% !important; }
.doc table.items:not(.compact) thead th:nth-child(8) { width: 16% !important; }
.doc td.doc-box-col { font-size: 10px; line-height: 1.1; white-space: normal; overflow-wrap: normal; word-break: normal; }

/* ===== "Oq va havorang" mavzusi: oq yon panel, havorang urg'u ===== */
body.sidebar-light .sidebar { color: #0c4a6e; border-right: 1px solid #bae6fd; box-shadow: none; }
body.sidebar-light .sidebar .brand { color: #0c4a6e; border-bottom-color: #e0f2fe; }
body.sidebar-light .sidebar .brand svg text { fill: #0c4a6e; }
body.sidebar-light .sidebar nav a { color: #0c4a6e; }
body.sidebar-light .sidebar nav a:hover { background: #e0f2fe; }
body.sidebar-light .sidebar nav a .ico { color: #0284c7; opacity: 1; }
body.sidebar-light .sidebar nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(2, 132, 199, .25); }
body.sidebar-light .sidebar nav a.active .ico { color: #fff; }
body.sidebar-light .sidebar nav a.active::before { display: none; }
body.sidebar-light .sidebar .user { color: #075985; border-top-color: #bae6fd; }
body.sidebar-light .sidebar .user a, body.sidebar-light .sidebar .back-branches, body.sidebar-light .sidebar .att a { color: #0284c7; }
body.sidebar-light .sidebar .att { color: #075985; }
body.sidebar-light .sidebar .branch-name { background: #e0f2fe; color: #0c4a6e; }
body.sidebar-light .sidebar .badge { background: var(--primary); color: #fff; }
body.sidebar-light .sidebar .lang-sw button { color: #075985; border-color: #bae6fd; }
body.sidebar-light .sidebar .lang-sw button.on { color: #fff; }
body.sidebar-light .topbar { background: #ffffff; color: #0c4a6e; border-bottom: 1px solid #bae6fd; }
body.sidebar-light .topbar .t, body.sidebar-light .topbar button { color: #0c4a6e; }
body.sidebar-light .topbar .badge { background: var(--primary) !important; color: #fff !important; }
body.sidebar-light .owner-top { background: #ffffff; color: #0c4a6e; border-bottom: 1px solid #bae6fd; }
body.sidebar-light .owner-top a, body.sidebar-light .owner-top .lang-sw button, body.sidebar-light .owner-me .muted { color: #0284c7; }
body.sidebar-light .owner-top .lang-sw button.on { color: #fff; }
body.sidebar-light .pos-bar, body.sidebar-light .reg-cash { background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; }
body.sidebar-light .login-wrap { background: linear-gradient(160deg, #ffffff 0%, #e0f2fe 55%, #bae6fd 100%); }
body.sidebar-light .login-wrap .card { box-shadow: 0 18px 50px rgba(2, 132, 199, .18); }
body.sidebar-light .login-foot { color: #075985; }
body.sidebar-light .login-wrap .lang-sw button { color: #075985; border-color: #bae6fd; }
body.sidebar-light .login-wrap .lang-sw button.on { color: #fff; }

/* Ilbar Cosmetics logotipi (keng, shaffof fonli): kirish sahifasida va yon panelda kattaroq */
.login-wrap .login-logo { width: 300px; max-width: 80vw; filter: drop-shadow(0 6px 18px rgba(122, 82, 48, .12)); }
.sidebar .brand .brand-logo { width: 176px; }
.owner-top .brand-logo { height: 48px; max-width: 170px; }
