:root {
  --brand:        #2d9142;
  --brand-d:      #1f6b30;
  --brand-l:      #4caf50;
  --side-bg:      #2d9142;
  --side-bg2:     #1f6b30;
  --side-active:  #ffffff;
  --side-active-t:#1f6b30;
  --side-text:    #e7f3ea;
  --side-muted:   #bcdcc4;
  --bg:           #eef2ec;
  --panel:        #ffffff;
  --line:         #e2e8df;
  --text:         #1b2a20;
  --muted:        #6c7d70;
  --ink:          #1f6b30;
  --green:        #1faa53;
  --red:          #e0483b;
  --gold:         #c2870e;
  --radius:       14px;
  --shadow:       0 1px 3px rgba(20,40,25,.06), 0 6px 24px rgba(20,40,25,.05);

  /* Admin panel faqat oq mavzuda. Buni aytib qo'ymasak, tizim qora
     rejimda bo'lganda nativ input/select/scrollbar qorayib ketadi va
     oq panel ichida o'qib bo'lmaydigan maydonlar paydo bo'ladi. */
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
.hidden { display: none !important; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── LOGIN ───────────────────────────────────────────────── */
.login-screen {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2d9142, #1f6b30);
}
.login-card {
  width: 380px; background: #fff; border-radius: 20px; padding: 34px 30px;
  box-shadow: 0 20px 60px rgba(20,30,80,.3); text-align: center;
}
.login-logo { width: 66px; height: 66px; object-fit: contain; border-radius: 16px; }
.login-card h1 { font-size: 26px; margin-top: 10px; color: var(--text); letter-spacing: .5px; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .server-box input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 15px; outline: none; transition: border-color .15s; background: #f7faf6;
}
.field input:focus, .server-box input:focus { border-color: var(--brand); background: #fff; }
.server-box { text-align: left; margin-bottom: 14px; }
.server-box summary { cursor: pointer; font-size: 13px; color: var(--brand); padding: 4px 0; user-select: none; }
.server-box input { margin-top: 8px; }
.server-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: 11px; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; transition: background .15s;
}
.btn-primary:hover { background: var(--brand-d); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ── ILOVA QOBIG'I ───────────────────────────────────────── */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--side-bg), var(--side-bg2));
  color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; }
.brand span { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.shop-card {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.14);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 16px; font-weight: 700; color: #fff;
}
.shop-ico { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 11px;
  cursor: pointer; color: var(--side-text); font-size: 15px; font-weight: 600;
  border: none; background: none; text-align: left; transition: background .12s;
}
.nav-item:hover { background: rgba(255,255,255,.1); }
.nav-item.active { background: var(--side-active); color: var(--side-active-t); }
.nav-item .ico { stroke: currentColor; }
.side-foot { margin-top: 12px; }
.ver { font-size: 12px; color: var(--side-muted); text-align: center; padding: 6px 0 10px; }

/* Yangilanish banneri (sidebar) */
.update-box { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.update-box.hidden { display: none; }
.update-box .ub-title { font-size: 13px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 7px; }
.update-box .ub-sub { font-size: 11.5px; color: var(--side-muted); margin: 3px 0 9px; }
.update-box .ub-btn { width: 100%; background: #fff; color: var(--brand-d); border: none; border-radius: 9px; padding: 8px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.update-box .ub-btn:hover { background: #eafbef; }
.update-box .ub-btn[disabled] { opacity: .7; cursor: default; }
.update-box .ub-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 4px; }
.update-box .ub-bar > i { display: block; height: 100%; background: #fff; transition: width .2s; }
.admin-row { display: flex; align-items: center; gap: 11px; background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; }
.admin-ava { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--brand-d); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.admin-meta { flex: 1; min-width: 0; }
.admin-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-logout { background: none; border: none; color: var(--side-muted); font-size: 12.5px; cursor: pointer; padding: 0; }
.admin-logout:hover { color: #fff; text-decoration: underline; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.tab-strip { display: flex; gap: 2px; padding: 10px 16px 0; background: var(--bg); flex-wrap: wrap; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px 11px 0 0;
  background: #e3ebe2; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; border: none;
}
.tab.active { background: var(--panel); color: var(--text); box-shadow: 0 -2px 8px rgba(20,30,80,.04); }
.tab .tab-x { font-size: 15px; color: var(--muted); border-radius: 5px; padding: 0 3px; }
.tab .tab-x:hover { background: rgba(0,0,0,.08); color: var(--red); }
.content { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }

/* ── Tiles (menyu kartalari) ─────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.tile {
  background: var(--brand); color: #fff; border-radius: var(--radius); padding: 26px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; cursor: pointer;
  border: none; transition: transform .1s, box-shadow .12s; box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(45,145,66,.32); }
.tile .ico { width: 34px; height: 34px; stroke: #fff; }
.tile span { font-size: 15px; font-weight: 600; text-align: center; }
.tile.soon { background: #a7bfac; cursor: default; }
.tile.soon:hover { transform: none; box-shadow: var(--shadow); }

/* ── Hisobot filtr paneli ────────────────────────────────── */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filter { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.filter label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.filter input, .filter select { border: none; outline: none; font-size: 15px; background: none; color: var(--text); padding: 2px 0; }
.btn-soft { background: var(--brand); color: #fff; border: none; border-radius: 11px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-soft:hover { background: var(--brand-d); }
.btn-soft.ghost { background: #e3ebe2; color: var(--ink); }

/* ── KPI kartalar ────────────────────────────────────────── */
.kpi-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; margin-bottom: 18px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { padding: 18px 22px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: none; }
.kpi .kpi-val { font-size: 23px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.kpi .kpi-val.green { color: var(--green); }
.kpi .kpi-lbl { font-size: 13px; color: var(--muted); margin-top: 3px; }
.kpi.lead .kpi-head { font-size: 15px; font-weight: 800; color: var(--brand); }
.kpi.lead .kpi-sub { font-size: 12px; color: var(--muted); }

/* ── Card / grafik ───────────────────────────────────────── */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1180px) { .card-row { grid-template-columns: 1fr; } }
.chart-svg { width: 100%; display: block; }
.chart-empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }

/* Interaktiv grafik (hover qiymati) */
.chart-wrap { position: relative; }
.chart-wrap .chart-svg { cursor: crosshair; }
.chart-legend { display: flex; gap: 18px; justify-content: flex-end; margin-top: 6px; }
.chart-legend .cl-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.chart-legend .cl-item i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 132px;
  background: #1f2a37; color: #fff; padding: 8px 11px; border-radius: 9px;
  font-size: 12px; box-shadow: 0 6px 18px rgba(10,20,15,.22);
}
.chart-tip.hidden { display: none; }
.chart-tip .ct-h { font-weight: 700; margin-bottom: 6px; opacity: .92; }
.chart-tip .ct-row { display: flex; align-items: center; gap: 7px; line-height: 1.85; }
.chart-tip .ct-row i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-tip .ct-row span { flex: 1; opacity: .82; }
.chart-tip .ct-row b { font-variant-numeric: tabular-nums; }

/* To'lov turlari (gorizontal bar) */
.paybars { display: flex; flex-direction: column; gap: 12px; }
.paybar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; }
.paybar-name { font-size: 14px; color: var(--text); }
.paybar-track { background: #e9f0ea; border-radius: 7px; height: 22px; overflow: hidden; }
.paybar-fill { height: 100%; background: var(--brand); border-radius: 7px; min-width: 2px; transition: width .4s; }
.paybar-val { font-size: 14px; font-weight: 600; color: var(--text); text-align: right; min-width: 90px; }
.paybar-total { text-align: right; font-weight: 700; margin-top: 14px; color: var(--text); }

/* ── Jadval ──────────────────────────────────────────────── */
.tbl-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; padding: 13px 16px; background: #f1f5ef; color: var(--muted); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
table.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #f7faf6; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.green { background: #e3f6ea; color: var(--green); }
.pill.gold { background: #fbf0d8; color: var(--gold); }
.pill.gray { background: #eef0f6; color: var(--muted); }
.pill.blue { background: #e0f0e6; color: var(--brand-d); }
.pill.red { background: #fde7e4; color: var(--red); }

/* Online savdo sarhisob chiplari */
.sum-chips { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.sum-chip { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 20px; min-width: 150px; }
.sum-chip .v { font-size: 22px; font-weight: 800; }
.sum-chip .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

.loading { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }
.err-box { background: #fde7e4; color: var(--red); padding: 14px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #1b2440; color: #fff; padding: 12px 22px; border-radius: 11px; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.3); z-index: 999; max-width: 80%;
}

/* ── Chip filtrlar (Cheklar) ─────────────────────────────── */
.rc-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rc-chip { background: #e3ebe2; color: var(--ink); border: none; border-radius: 20px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rc-chip.active { background: var(--brand); color: #fff; }

/* ── Master-detail (ro'yxat + detal) ─────────────────────── */
.master-detail { display: grid; grid-template-columns: 370px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1060px) { .master-detail { grid-template-columns: 1fr; } }
.md-list { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; max-height: calc(100vh - 240px); overflow-y: auto; }
.md-row { padding: 11px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.md-row:hover { background: #f2f7f0; }
.md-row.active { background: #e7f3e9; border-color: var(--brand-l); }
.md-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.md-row-sub { display: flex; justify-content: space-between; margin-top: 3px; font-size: 13px; color: var(--muted); }
.md-row-cli { font-size: 12px; color: var(--muted); margin-top: 2px; }
.md-detail { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; min-height: 220px; }

/* ── Chek detali ─────────────────────────────────────────── */
.rc-d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rc-d-no { font-size: 18px; font-weight: 800; }
.rc-d-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rc-d-cli { margin-top: 8px; font-size: 14px; }
.rc-d-tot { margin-top: 14px; border-top: 2px solid var(--line); padding-top: 12px; }
.rc-d-tot > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.rc-d-grand { font-size: 18px; color: var(--text) !important; font-weight: 800; }

/* ── Jadvaldagi raqam inputi + checkbox (Sennik) ─────────── */
.qty-inp { width: 90px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 14px; text-align: right; outline: none; }
.qty-inp:focus { border-color: var(--brand); }
.pt-chk { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }

/* ── Prixod kartasi ──────────────────────────────────────── */
.px-card { max-width: 430px; }
.px-name { font-size: 19px; font-weight: 800; }
.px-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.px-cur { margin: 14px 0; font-size: 15px; }
.px-cur b { font-size: 22px; color: var(--brand-d); }
.px-field { margin-top: 6px; }
.px-field input { width: 100%; font-size: 18px; }
.px-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.px-msg.ok { color: var(--green); }
.px-msg.err { color: var(--red); }

/* ── Qabul qilish (prixod): qidiruv natijalari + jadval ───── */
.px-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-top: 4px; z-index: 30; max-height: 330px; overflow-y: auto; }
.px-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 14px; }
.px-res:last-child { border-bottom: none; }
.px-res:hover { background: #f2f7f0; }
.px-res small { color: var(--muted); }
.px-res-empty { padding: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.px-tbl input.qty-inp { width: 104px; }
.px-foot td { background: #f1f5ef; font-size: 15px; }
.px-del { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 9px; border-radius: 6px; }
.px-del:hover { background: #fde7e4; color: var(--red); }

/* ── Yangi tovar modal ───────────────────────────────────── */
.np-overlay { position: fixed; inset: 0; background: rgba(18,28,18,.46); display: flex; align-items: center; justify-content: center; z-index: 200; }
.np-modal { width: 560px; max-width: 92vw; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; }
.np-x { background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.np-body { padding: 18px 20px; }
.np-sku { background: #eef6ef; color: var(--brand-d); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.np-sku small { color: var(--muted); font-weight: 400; }
.np-l { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin: 10px 0 5px; }
.np-inp { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; outline: none; background: #fafdf9; }
.np-inp:focus { border-color: var(--brand); background: #fff; }
.np-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── Ko'p shtrix-kod (chip) kiritish maydoni ─────────────────────────────── */
.bc-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fafdf9; cursor: text; min-height: 42px; }
.bc-wrap:focus-within { border-color: var(--brand); background: #fff; }
.bc-chip { display: inline-flex; align-items: center; gap: 6px;
  background: #eef6ef; color: var(--brand-d); border-radius: 8px;
  padding: 4px 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.bc-chip b { cursor: pointer; color: var(--muted); font-weight: 700; }
.bc-chip b:hover { color: #c0392b; }
.bc-inp { flex: 1; min-width: 130px; border: none; outline: none;
  background: transparent; font-size: 14px; padding: 4px 2px; }
.np-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }

/* ── AI Prixod — rasmdan to'ldirish ───────────────────────────────────────── */
.btn-soft.px-ai { background: var(--gold); }
.btn-soft.px-ai:hover { background: #a9760a; }

/* Yuklash overlayi (AI o'qiyapti) */
.px-scan-ov { position: fixed; inset: 0; background: rgba(20,40,25,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.px-scan-box { background: #fff; border-radius: 16px; padding: 28px 34px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; font-size: 15px; color: var(--text); }
.px-scan-box small { color: var(--muted); }
.px-spin { width: 38px; height: 38px; border: 4px solid #e2ece4; border-top-color: var(--brand); border-radius: 50%; animation: pxspin .8s linear infinite; }
@keyframes pxspin { to { transform: rotate(360deg); } }

/* Yig'indi satri */
.px-scan-sum { background: #eef6ef; border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; margin: 10px 0 4px; font-size: 14px; color: var(--text); }
.px-scan-sum .ok { color: var(--green); }
.px-scan-sum .mid { color: var(--gold); }

/* Skanlangan qator + ishonch + nakladnoy nomi + narx farqi */
.px-tbl tr.px-scanned td { background: #fbfdf8; }
.px-conf { display: inline-block; min-width: 34px; text-align: center; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 7px; vertical-align: middle; }
.px-conf.ok { background: #e3f4e8; color: var(--green); }
.px-conf.mid { background: #fbf0d8; color: var(--gold); }
.px-raw { font-size: 11px; color: var(--muted); margin-top: 2px; }
.px-diff { font-size: 11px; margin-top: 3px; font-weight: 600; white-space: nowrap; }
.px-diff.up { color: var(--red); }
.px-diff.down { color: var(--green); }
.px-diff.same { color: var(--muted); }
.px-diff.new { color: var(--gold); }

/* Prixodni saqlash — tasdiqlash modali */
.pc-sum { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pc-sum > div { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg, #f3f4f8); border-radius: 8px; }
.pc-sum span { color: var(--muted); font-size: 13px; }
.pc-sum b { font-size: 15px; }
.pc-warn { margin-top: 12px; font-size: 12px; color: var(--gold); }

/* Valyuta (so'm/dollar) kiritish */
.px-cur { font-weight: 700; }
.px-cur.usd { background: var(--green); color: #fff; border-color: var(--green); }
.px-cur-hint { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.px-eski { color: var(--muted); }

/* Tekshirish (review) bo'limi */
.px-review { border: 1.5px solid #f0dca6; background: #fffaf0; border-radius: 12px; padding: 12px 14px; margin: 8px 0 14px; }
.px-review-h { font-size: 13px; color: #8a6400; font-weight: 600; margin-bottom: 10px; }
.px-rv-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f0e2c0; flex-wrap: wrap; }
.px-rv-row:first-of-type { border-top: none; }
.px-rv-name { flex: 1; min-width: 220px; font-size: 14px; }
.px-rv-name small { color: var(--muted); margin-left: 6px; }
.px-rv-sel { padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; font-size: 13px; min-width: 200px; }
.btn-soft.px-rv-ok { padding: 7px 14px; font-size: 13px; }
.px-rv-skip { font-size: 15px; }

/* ── Prixod tarixi (oldingi qabullar) ─────────────────────────────────────── */
.ph-sum { background: #eef6ef; border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; margin: 10px 0; font-size: 14px; color: var(--text); }
.ph-sum b { color: var(--brand-d); }
.ph-row { cursor: pointer; }
.ph-row:hover td { background: #f2f7f0; }
.ph-row.open td { background: #eaf3ec; font-weight: 600; }
.ph-det td { background: #fbfdf8; font-size: 13px; color: var(--muted); border-top: none; }
.ph-det-name { color: var(--text); }

/* ── Yetkazib beruvchilar (suppliers) ─────────────────────────────────────── */
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.bar-row .sum-chips { margin-bottom: 0; }
.muted { color: var(--muted); }
.btn-mini { background: #eef2ee; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font-size: 14px; cursor: pointer; line-height: 1; }
.btn-mini:hover { background: #e1e9e0; }
.btn-mini.danger:hover { background: #fde2e2; border-color: #f3b4b4; }
.badge-low { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #fde2e2; color: #c0392b; font-weight: 700; font-size: 12px; }
.sup-sel { max-width: 210px; padding: 5px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: #fafdf9; font-size: 13px; outline: none; cursor: pointer; }
.sup-sel:focus { border-color: var(--brand); background: #fff; }
.sup-sel:disabled { opacity: .55; cursor: default; }
.px-sup-sel { padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: #fafdf9; font-size: 14px; outline: none; cursor: pointer; }
.px-sup-sel:focus { border-color: var(--brand); background: #fff; }
.px-sup-sel.need { border-color: #e74c3c; background: #fff5f5; }

/* ── Sozlamalar sahifasi ──────────────────────────────────────────────────── */
.set-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 680px; }
.set-rate { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.set-rate .np-inp { margin: 0; }
.set-hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.set-warn { margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: #fff7e0; border: 1px solid #f0dfa3; color: #8a6d1a; font-size: 13px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-txt b { display: block; font-size: 14px; }
.set-txt small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* Toggle switch */
.sw { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: #d4d9e4; transition: background .18s; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.sw input:checked + i { background: var(--brand); }
.sw input:checked + i::after { transform: translateX(20px); }
.sw input:disabled + i { opacity: .5; }

/* ── Mijozlar boshqaruvi + kartochka ─────────────────────────────────────── */
.kpi .kpi-val.red { color: var(--red); }
.debt-pos { color: var(--red); font-weight: 700; }
.bonus-pos { color: var(--green); font-weight: 700; }
.green-txt { color: var(--green); }
.pill-btn { background: none; border: none; padding: 0; cursor: pointer; }
.pill-btn:hover .pill { filter: brightness(.93); }
.cli-name { cursor: pointer; }
.cli-name:hover b { text-decoration: underline; }
.sw.sw-sm { width: 38px; height: 22px; }
.sw.sw-sm i::after { width: 16px; height: 16px; }
.sw.sw-sm input:checked + i::after { transform: translateX(16px); }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cc-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.cc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-last { color: var(--muted); font-size: 13px; margin-top: 10px; }
.cc-row { cursor: pointer; }
.cc-row:hover td { background: #f4f8f4; }
.top-medal { font-size: 16px; font-weight: 700; }
.top-row { cursor: pointer; }
.top-row:hover td { background: #f4f8f4; }
.top-row .paybar-track { height: 8px; margin-bottom: 4px; max-width: 220px; }

/* ── Xodimlar boshqaruvi + KPI ───────────────────────────────────────────── */
.stf-pending td { background: #fbf7ea; }
.stf-role { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; background: #fff; cursor: pointer; }
.kpi-row { cursor: pointer; }
.kpi-row:hover td { background: #f4f8f4; }
.kpi-row.active td { background: #eaf4ec; }

/* ═══════ Rasmsiz tovarlar ═══════ */
.np-head { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.np-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.np-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.np-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.np-tip { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.np-th {
  width: 44px; height: 44px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line); background: #f5f8f4; display: block;
}
.np-th.np-no {
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: var(--muted);
}
.np-tag {
  font-size: 11px; color: var(--red); background: #fdeceb;
  border-radius: 6px; padding: 2px 6px; margin-left: 6px; white-space: nowrap;
}
#npBody tr.np-drop td { background: #e8f5ea; box-shadow: inset 0 0 0 2px var(--brand); }
.np-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 14px; font-size: 13.5px; color: var(--muted);
}

/* ═══════ Kameralar ═══════ */
.cam-count { font-size: 15px; font-weight: 700; color: var(--text); padding: 6px 0; }
.cam-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cam-card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: transform .12s;
}
.cam-card:hover { transform: translateY(-2px); }
.cam-shot { position: relative; aspect-ratio: 16/9; background: #0d1410; }
.cam-shot img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s;
}
.cam-shot img.on { opacity: 1; }
.cam-state {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #8ca394; font-size: 13px;
}
.cam-name { padding: 10px 12px; font-size: 14px; font-weight: 600; }

/* To'liq ekran */
.cam-ov { position: fixed; inset: 0; z-index: 9999; background: #000; display: none; flex-direction: column; }
.cam-ov-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; color: #fff; font-size: 15px;
}
.cam-ov-acts { display: flex; align-items: center; gap: 8px; }
.cam-ov-acts button {
  background: rgba(255,255,255,.14); color: #fff; border: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; font-size: 15px;
}
.cam-ov-acts button:hover { background: rgba(255,255,255,.26); }
.cam-ov-acts button.on { background: var(--brand); }
.cam-ov-zk { min-width: 46px; text-align: center; font-size: 12px; color: #9aa7b2; }
.cam-ov-num { font-weight: 600; font-size: 13px; color: #9aa7b2; margin-left: 6px; }
.cam-ov-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cam-ov-body img { max-width: 100%; max-height: 100%; transform-origin: center center; }
.cam-ov-body.kattalashgan img { cursor: grab; }
.cam-ov-body.kattalashgan .cam-ov-nav { opacity: .25; }
.cam-ov-wait { position: absolute; color: #9aa7b2; font-size: 14px; }
.cam-ov-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 72px; border: 0; cursor: pointer; z-index: 2;
  background: rgba(255,255,255,.12); color: #fff; font-size: 28px; border-radius: 12px;
}
.cam-ov-nav:hover { background: rgba(255,255,255,.24); }
.cam-ov-nav.chap { left: 10px; }
.cam-ov-nav.ong { right: 10px; }
.cam-ov-foot { padding: 10px 14px 16px; color: #6f7b85; font-size: 12.5px; text-align: center; }

/* ═══════ Moliya / buyurtma / AI ═══════ */
.cm-dir { font-size: 12.5px; font-weight: 600; }
.cm-dir.in  { color: var(--green); }
.cm-dir.out { color: var(--red); }
.ro-skip td { opacity: .55; }
.ai-answer { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; }

/* ═══════ Tovar tahrir: rasm bloki ═══════ */
.pe-img {
  display: flex; gap: 14px; align-items: flex-start; padding: 12px;
  border: 1px dashed var(--line); border-radius: 12px; background: #fafcf9;
}
.pe-img img, .pe-img .pe-img-no {
  width: 96px; height: 96px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: #fff; flex-shrink: 0;
}
.pe-img .pe-img-no {
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--muted);
}
.pe-img-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pe-img-st { font-size: 13px; font-weight: 600; }
.pe-img.np-drop { background: #e8f5ea; border-color: var(--brand); }
.np-th.umumiy { outline: 2px solid #f0b4ae; }
.btn-soft.danger-txt { background: #fdeceb; color: var(--red); }
.btn-soft.danger-txt:hover { background: #fbd9d6; }
textarea.np-inp { resize: vertical; font-family: inherit; }

/* Maslahatlar modali kengroq (uzun javob matni uchun) */
.np-modal.wide { width: 820px; max-width: 94vw; }
.g-ans { font-size: 13px; color: var(--muted); max-width: 520px; }

/* ═══════ Yorliq o'qitish ═══════ */
.lb-photos { display: flex; gap: 10px; flex-wrap: wrap; }
.lb-photos img {
  width: 150px; height: 150px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line);
}
.card.np-drop { background: #e8f5ea; outline: 2px dashed var(--brand); }
.lb-f { margin-bottom: 4px; }
.lb-res { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 4px; }
.lb-res-row {
  display: block; width: 100%; text-align: left; padding: 10px 14px; cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text);
}
.lb-res-row:last-child { border-bottom: none; }
.lb-res-row:hover { background: #f2f7f0; }
