/* KassaCRM — LeetCode uslubidagi dizayn tizimi. Tun (default) va kun (body.light). */

:root {
  --bg: #1a1a1a;
  --panel: #282828;
  --panel-2: #303030;
  --panel-3: #3a3a3a;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --hover: rgba(255, 255, 255, 0.06);
  --text: #eff1f6;
  --text-2: #c9cbd1;
  --muted: #8a8a8a;
  --orange: #ffa116;
  --orange-soft: rgba(255, 161, 22, 0.16);
  --green: #2cbb5d;
  --green-soft: rgba(44, 187, 93, 0.16);
  --yellow: #ffc01e;
  --yellow-soft: rgba(255, 192, 30, 0.16);
  --red: #ff375f;
  --red-soft: rgba(255, 55, 95, 0.16);
  --blue: #0a84ff;
  --blue-soft: rgba(10, 132, 255, 0.16);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 8px;
  --sidebar: 224px;
  --topbar: 54px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
body.light {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #f2f3f4;
  --panel-3: #e8e9eb;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);
  --hover: rgba(0, 0, 0, 0.045);
  --text: #262626;
  --text-2: #3c3c43;
  --muted: #8c8c8c;
  --orange-soft: rgba(255, 161, 22, 0.14);
  --green-soft: rgba(44, 187, 93, 0.13);
  --yellow-soft: rgba(255, 192, 30, 0.18);
  --red-soft: rgba(255, 55, 95, 0.12);
  --blue-soft: rgba(10, 132, 255, 0.12);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; font: 14px/1.5 var(--font);
  background: var(--bg); color: var(--text);
  transition: background .15s, color .15s;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.accent { color: var(--orange); }
.ok { color: var(--green); }
.warn { color: var(--yellow); }
.bad { color: var(--red); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.gap-lg { gap: 16px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 4px;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; text-decoration: none; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; display: block; flex: none; }
body.light .brand .logo { content: url("/static/web/brand/bozorlink-mark.svg"); }
.auth .brand .logo { width: 44px; height: 44px; }
.brand b { font-size: 16px; }
.brand small { display: block; color: var(--muted); font-size: 11px; line-height: 1.1; }
.nav-label { padding: 12px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius);
  color: var(--text-2); text-decoration: none; position: relative; font-weight: 500;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--panel-2); color: var(--text); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--orange);
}
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.nav-item kbd { margin-left: auto; }
.sidebar .spacer { flex: 1; }
.sidebar-user {
  border-top: 1px solid var(--line); padding: 12px 10px 4px; display: flex; gap: 10px; align-items: center;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--orange-soft); color: var(--orange);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.sidebar-user .who { min-width: 0; }
.sidebar-user .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { font-weight: 600; font-size: 15px; }
.topbar .crumb span { color: var(--muted); font-weight: 400; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar select { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; }
.burger { display: none; }
.content { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.page-head .sub { width: 100%; color: var(--muted); font-size: 13px; margin-top: -6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30; width: var(--sidebar);
    transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .burger { display: inline-flex; }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .topbar .crumb span { display: none; }
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 25; }

/* ---------- Kartalar ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.pad-0 { padding: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin-right: auto; }
.card.pad-0 .card-head { padding: 14px 16px 0; }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.kpi { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.easy .value { color: var(--green); }
.kpi.medium .value { color: var(--yellow); }
.kpi.hard .value { color: var(--red); }
.kpi.accent .value { color: var(--orange); }
.kpi.blue .value { color: var(--blue); }
.kpi::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%;
  background: var(--hover);
}

/* ---------- Pill'lar (LC difficulty) ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  background: var(--panel-3); color: var(--text-2);
}
.pill.easy { background: var(--green-soft); color: var(--green); }
.pill.medium { background: var(--yellow-soft); color: var(--yellow); }
.pill.hard { background: var(--red-soft); color: var(--red); }
.pill.accent { background: var(--orange-soft); color: var(--orange); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text); background: var(--panel-2);
  transition: filter .12s, background .12s, border-color .12s; white-space: nowrap; line-height: 1.4;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.primary { background: var(--green); color: #fff; }
.btn.accent { background: var(--orange); color: #1a1a1a; }
.btn.danger { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-strong); background: var(--hover); }
.btn.link { background: transparent; color: var(--blue); padding: 4px 6px; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 6px 8px; }
.btn.block { width: 100%; }
kbd {
  font-family: var(--mono); font-size: 11px; opacity: .75; padding: 1px 5px;
  border: 1px solid currentColor; border-radius: 4px; line-height: 1.3;
}
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Formalar ---------- */
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
label.field > span { font-weight: 500; }
label.field.inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea {
  padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft);
}
input[type="checkbox"] { width: auto; accent-color: var(--orange); }
input.invalid, select.invalid { border-color: var(--red); }
select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.form { display: grid; gap: 12px; }
.form.cols { grid-template-columns: 1fr 1fr; }
.form .full { grid-column: 1 / -1; }
.form-error { color: var(--red); font-size: 13px; padding: 8px 12px; background: var(--red-soft); border-radius: var(--radius); }
.hint { font-size: 12px; color: var(--muted); }
.search {
  position: relative;
}
.search input { padding-left: 34px; }
.search::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: 200px; }
.toolbar select, .toolbar input[type="date"], .toolbar input[type="number"] { width: auto; }

/* ---------- Jadval ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:nth-child(odd) { background: var(--panel-2); }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.num b { color: var(--orange); }
.tbl .actions { display: flex; gap: 4px; justify-content: flex-end; }
.tbl .primary-cell { font-weight: 500; }
.tbl .sub-cell { font-size: 12px; color: var(--muted); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; font-size: 15px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ---------- Tablar ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--orange); }
.tab .count { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--panel-3); }

/* ---------- Skeleton ---------- */
.skeleton { display: flex; flex-direction: column; gap: 10px; }
.sk { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk.lg { height: 26px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Dialog ---------- */
dialog.dlg {
  border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(520px, 94vw);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow);
}
dialog.dlg.wide { width: min(820px, 94vw); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.dlg-head h3 { margin-right: auto; font-size: 16px; }
.dlg-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 16px; }
.dlg-foot .left { margin-right: auto; }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 380px; }
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px;
  animation: toast-in .18s ease-out, fade 4s forwards; display: flex; gap: 8px; align-items: flex-start;
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--yellow); }
.toast.info { border-left-color: var(--blue); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Badge (sync) ---------- */
.badge { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--green-soft); color: var(--green); cursor: default; }
.badge.pending { background: var(--yellow-soft); color: var(--yellow); }
.badge.offline { background: var(--red-soft); color: var(--red); }
.badge.err { cursor: pointer; }

/* ---------- Auth ekrani ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.auth::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; top: -220px; right: -160px;
  background: radial-gradient(circle, var(--orange-soft), transparent 70%); pointer-events: none;
}
.auth .card { width: 360px; display: flex; flex-direction: column; gap: 12px; padding: 26px; position: relative; }
.auth .brand { padding: 0 0 8px; }
.auth .corner { position: absolute; bottom: 16px; left: 16px; display: flex; gap: 6px; }
.auth .corner select { width: auto; }

/* ---------- Kassa ---------- */
.pos { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; min-height: calc(100vh - var(--topbar) - 36px); }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; min-height: 0; } }
.pos .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.chip:hover { background: var(--hover); }
.chip.active { background: var(--orange-soft); color: var(--orange); border-color: transparent; font-weight: 600; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; overflow-y: auto; max-height: 62vh; padding-right: 2px; }
.product {
  text-align: left; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2);
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: var(--text); min-height: 78px; transition: border-color .12s, background .12s;
}
.product:hover { border-color: var(--orange); background: var(--hover); }
.product .name { font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .price { color: var(--orange); font-weight: 700; margin-top: auto; }
.product .meta { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.product .code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.cart-head { display: flex; gap: 8px; align-items: center; }
.cart-box { flex: 1; overflow-y: auto; min-height: 120px; }
.cart-line { display: grid; grid-template-columns: 1fr 88px 96px 100px 28px; gap: 6px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.cart-line:nth-child(odd) { background: var(--panel-2); }
.cart-line .n { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line input { padding: 5px 8px; text-align: right; font-size: 13px; }
.cart-line .rm { background: none; border: 0; color: var(--red); cursor: pointer; font-size: 15px; }
.cart-line .t { text-align: right; font-weight: 600; }
.cart-header { display: grid; grid-template-columns: 1fr 88px 96px 100px 28px; gap: 6px; padding: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cart-header span:not(:first-child) { text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 4px 4px; border-top: 1px solid var(--line-strong); }
.total .sum { font-size: 26px; font-weight: 700; color: var(--orange); font-variant-numeric: tabular-nums; }
.pay-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay { padding: 12px 8px; font-weight: 600; font-size: 14px; flex-direction: column; gap: 2px; }
.pay small { font-weight: 400; opacity: .8; font-size: 11px; }
.pay.naqd { background: var(--green); color: #fff; }
.pay.karta { background: var(--blue); color: #fff; }
.pay.click { background: var(--orange); color: #1a1a1a; }
.pay.qarz { background: var(--yellow); color: #1a1a1a; }
.pay.mixed, .pay.other { background: var(--panel-2); border: 1px solid var(--line); }
.mixed-fields { display: grid; gap: 8px; }
.mixed-fields label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mixed-fields input { width: 160px; text-align: right; }
.quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Chek (print) ---------- */
.receipt { font-family: var(--mono); font-size: 12.5px; width: 100%; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .tot { font-weight: 700; font-size: 14px; }
@media print {
  body { background: #fff; color: #000; }
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 58mm; padding: 2mm; }
  .receipt hr { border-top-color: #000; }
}

/* ---------- Chart ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart .bar { fill: var(--orange); opacity: .9; }
.chart .bar.today { fill: var(--green); }
.chart .bar:hover { opacity: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .val { fill: var(--text-2); font-size: 10.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 110px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bars .track { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bars .fill { height: 100%; border-radius: 4px; background: var(--orange); }
.bars .fill.green { background: var(--green); }
.bars .fill.blue { background: var(--blue); }
.bars .fill.yellow { background: var(--yellow); }
.bars .fill.red { background: var(--red); }

/* ---------- Detallar ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.status-flow { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.status-flow .step { padding: 2px 10px; border-radius: 999px; background: var(--panel-3); }
.status-flow .step.done { background: var(--green-soft); color: var(--green); }
.status-flow .step.cur { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.status-flow .step.cancel { background: var(--red-soft); color: var(--red); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow b { display: block; font-weight: 500; }
.list-item .grow span { font-size: 12px; color: var(--muted); }
.callout { padding: 10px 14px; border-radius: var(--radius); background: var(--blue-soft); color: var(--text-2); font-size: 13px; border-left: 3px solid var(--blue); }
.callout.warn { background: var(--yellow-soft); border-left-color: var(--yellow); }
.callout.bad { background: var(--red-soft); border-left-color: var(--red); }
.callout.ok { background: var(--green-soft); border-left-color: var(--green); }
.select-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; }
.select-list .opt { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; border: 1px solid transparent; }
.select-list .opt:hover { background: var(--hover); border-color: var(--line); }
.select-list .opt.active { background: var(--orange-soft); border-color: transparent; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.online-dot.off { background: var(--red); }

/* ---------- Ikonkalar ---------- */
.ico { flex: none; vertical-align: -3px; }
.btn .ico + span, .nav-item .ico + span { margin-left: 2px; }
.nav-item .ico { width: 18px; height: 18px; color: var(--muted); }
.nav-item.active .ico, .nav-item:hover .ico { color: var(--orange); }
.badge { display: inline-flex; align-items: center; gap: 5px; }
.toast b { display: inline-flex; }

/* ---------- Kassa qo'shimchalar ---------- */
.cart-tabs { display: flex; gap: 4px; align-items: center; overflow-x: auto; }
.cart-tabs .tab { padding: 6px 12px; font-size: 13px; }
.product { position: relative; }
.product .fav { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; opacity: .55; }
.product .fav:hover, .product .fav.on { opacity: 1; color: var(--orange); }
.product .fav.on .ico { fill: var(--orange); }
.profit-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.profit-row b { color: var(--green); }
.scan-frame { position: relative; width: min(92vw, 360px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; margin: 0 auto; background: #000; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame .corners { position: absolute; inset: 6%; border: 2px solid var(--orange); border-radius: 12px; pointer-events: none; }
.scan-frame .line { position: absolute; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, transparent, var(--orange), transparent); box-shadow: 0 0 10px 2px var(--orange-soft); animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0% { top: 8%; } 50% { top: 88%; } 100% { top: 8%; } }
.receipt.w80 { font-size: 13.5px; }
@media print { #print-area.w80 { width: 80mm; } }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }

/* ---------- Legacy funksiyalar ---------- */
.product .thumb { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; margin-bottom: 2px; }
.product.has-img { min-height: 120px; }
.thumb-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; vertical-align: middle; background: var(--panel-3); }
.thumb-box { width: 36px; height: 36px; border-radius: 6px; background: var(--panel-3); display: inline-grid; place-items: center; color: var(--muted); }
.img-preview { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--panel-3); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.quick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color .12s, transform .12s; }
.quick-btn:hover { border-color: var(--orange); transform: translateY(-1px); }
.quick-btn b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.quick-btn small { color: var(--muted); font-size: 12px; }
.quick-btn .ico { color: var(--orange); }
.kirim-rows { display: flex; flex-direction: column; gap: 8px; }
.kirim-row { display: grid; grid-template-columns: 1.4fr 90px 110px 110px 80px 100px 28px; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.kirim-row .n b { display: block; font-size: 13px; } .kirim-row .n span { font-size: 11px; color: var(--muted); }
.kirim-row input { padding: 5px 8px; font-size: 13px; text-align: right; }
.kirim-row .sum { text-align: right; font-weight: 600; font-size: 13px; }
.kirim-head { display: grid; grid-template-columns: 1.4fr 90px 110px 110px 80px 100px 28px; gap: 6px; padding: 0 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; }
@media (max-width: 900px) { .kirim-row, .kirim-head { grid-template-columns: 1fr 1fr 1fr; } .kirim-head { display: none; } }
.printer-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.printer-dot .online-dot { width: 7px; height: 7px; }
.cart-warn { font-size: 11px; color: var(--red); }
.inline-edit { width: 90px; padding: 4px 8px; font-size: 13px; text-align: right; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-row:last-child { border-bottom: 0; }
.act-row .when { color: var(--muted); font-size: 12px; width: 110px; flex: none; }
.act-row .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-row .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.banner.closed { border-color: var(--green); background: var(--green-soft); }
.banner .grow { flex: 1; }

/* ---------- Sidebar rail (yig'iladigan, hover'da ochiladi) ---------- */
.shell.rail { grid-template-columns: 64px 1fr; }
.shell.rail .sidebar { width: 64px; padding: 14px 8px; overflow: visible; z-index: 30; transition: width .15s; }
.shell.rail .sidebar .brand span:last-child, .shell.rail .sidebar .nav-label, .shell.rail .sidebar .nav-item > span,
.shell.rail .sidebar .sidebar-user .who, .shell.rail .sidebar .sidebar-user .btn { display: none; }
.shell.rail .sidebar .nav-item { justify-content: center; padding: 10px; }
.shell.rail .sidebar .brand { justify-content: center; padding: 6px 0 16px; }
.shell.rail .sidebar .sidebar-user { justify-content: center; padding: 12px 0 4px; }
.shell.rail .sidebar .nav-label { height: 8px; padding: 0; }
@media (min-width: 901px) {
  .shell.rail .sidebar:hover { width: var(--sidebar); padding: 14px 10px; box-shadow: var(--shadow); }
  .shell.rail .sidebar:hover .brand span:last-child, .shell.rail .sidebar:hover .nav-label, .shell.rail .sidebar:hover .nav-item > span,
  .shell.rail .sidebar:hover .sidebar-user .who, .shell.rail .sidebar:hover .sidebar-user .btn { display: block; }
  .shell.rail .sidebar:hover .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .shell.rail .sidebar:hover .brand { justify-content: flex-start; padding: 6px 10px 16px; }
  .shell.rail .sidebar:hover .sidebar-user { justify-content: flex-start; padding: 12px 10px 4px; }
  .shell.rail .sidebar:hover .nav-label { height: auto; padding: 12px 12px 4px; }
  .shell.rail .sidebar:hover .sidebar-user .btn { display: inline-flex; }
  .rail-toggle { display: inline-flex; }
}
.rail-toggle { display: none; }
.sidebar .rail-toggle { position: absolute; right: 8px; top: 14px; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); z-index: 31; }
.sidebar .rail-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.shell.rail .sidebar .rail-toggle { display: none; }
@media (min-width: 901px) { .shell.rail .sidebar:hover .rail-toggle { display: inline-flex; } }
/* Tugma bosilgach sichqoncha chiqib ketguncha hover ochilmaydi */
.shell.rail .sidebar.hold-closed:hover { width: 64px; padding: 14px 8px; box-shadow: none; }
.shell.rail .sidebar.hold-closed:hover .brand span:last-child, .shell.rail .sidebar.hold-closed:hover .nav-label, .shell.rail .sidebar.hold-closed:hover .nav-item > span,
.shell.rail .sidebar.hold-closed:hover .sidebar-user .who, .shell.rail .sidebar.hold-closed:hover .sidebar-user .btn, .shell.rail .sidebar.hold-closed:hover .rail-toggle,
.shell.rail .sidebar.hold-closed:hover .side-store span, .shell.rail .sidebar.hold-closed:hover .side-status .badge span { display: none; }
.shell.rail .sidebar.hold-closed:hover .nav-item { justify-content: center; padding: 10px; }
.shell.rail .sidebar.hold-closed:hover .brand { justify-content: center; padding: 6px 0 16px; }
.shell.rail .sidebar.hold-closed:hover .sidebar-user { justify-content: center; padding: 12px 0 4px; }
.shell.rail .sidebar.hold-closed:hover .nav-label { height: 8px; padding: 0; }
.shell.rail .sidebar.hold-closed:hover .side-status { padding: 8px 0; align-items: center; }
.shell.rail .sidebar.hold-closed:hover .side-status .badge { padding: 4px 6px; }
.sidebar { position: sticky; }

/* ---------- Kassa: savat to'liq, tovarlar qidiruv ostida ---------- */
.pos.full { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar) - 36px); }
.pos.full .pos-top { position: relative; z-index: 15; }
.pos.full .pos-cart { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pos.full .cart-box { flex: 1; min-height: 240px; max-height: none; }
.pos.full .cart-line { grid-template-columns: 1fr 110px 130px 130px 32px; padding: 10px 6px; font-size: 15px; }
.pos.full .cart-header { grid-template-columns: 1fr 110px 130px 130px 32px; }
.pos.full .products { position: absolute; left: 14px; right: 14px; top: 100%; max-height: 55vh; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); z-index: 20; }
.pos.full .pay-row { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .pos.full .pay-row { grid-template-columns: repeat(3, 1fr); } }
.pos.full .total .sum { font-size: 34px; }
.pos.full .pos-top .chips .chip.fav-toggle.active { background: var(--orange); color: #1a1a1a; }

@media (min-width: 901px) { .sidebar .rail-toggle { display: inline-flex; align-items: center; justify-content: center; } }
.cart-tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.cart-tabs::-webkit-scrollbar { display: none; }

/* ---------- Yuqori panel yo'q: sidebar holat bloki, mobil burger ---------- */
.mobile-burger { display: none; position: fixed; top: 10px; left: 10px; z-index: 28; background: var(--panel); border: 1px solid var(--line); }
@media (max-width: 900px) { .mobile-burger { display: inline-flex; } .content { padding-top: 52px; } }
.side-status { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; }
.side-store { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; overflow: hidden; }
.side-store span { overflow: hidden; text-overflow: ellipsis; }
.side-store:hover { color: var(--text); text-decoration: none; }
.side-status .badge { justify-content: center; }
.shell.rail .side-status { padding: 8px 0; align-items: center; }
.shell.rail .side-store span, .shell.rail .side-status .badge span { display: none; }
.shell.rail .side-status .badge { padding: 4px 6px; }
@media (min-width: 901px) {
  .shell.rail .sidebar:hover .side-status { padding: 8px 10px; align-items: stretch; }
  .shell.rail .sidebar:hover .side-store span, .shell.rail .sidebar:hover .side-status .badge span { display: inline; }
  .shell.rail .sidebar:hover .side-status .badge { padding: 3px 12px; }
}
.sidebar-user .avatar { text-decoration: none; }
.content { padding-top: 18px; }

/* ---------- Kassa: ixcham burchak tugmalari ---------- */
.pos.full .cart-corner { margin-left: auto; gap: 6px; }
.pos.full .cust-btn { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos.full .pay-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.pos.full .pay { flex: 0 0 auto; min-width: 118px; padding: 8px 12px; font-size: 13px; flex-direction: row; gap: 6px; }
.pos.full .pay small { font-size: 10px; }
.pos.full .quick-actions { justify-content: flex-end; align-items: center; }
.pos.full .quick-actions .btn { padding: 4px 8px; font-size: 12px; }
.pos.full .quick-actions .hint { order: -1; margin-right: auto; }
.pos.full .total { padding: 8px 4px 2px; }
.pos.full .total .sum { font-size: 30px; }
.pos.full .quick-actions .hint { flex: 1 1 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }

.quick-btn.big { padding: 22px 18px; gap: 8px; } .quick-btn.big b { font-size: 16px; }

.fav-star { background: none; border: 0; padding: 4px; color: var(--muted); cursor: pointer; opacity: .6; display: inline-flex; }
.fav-star:hover, .fav-star.on { opacity: 1; color: var(--orange); }
.fav-star.on .ico { fill: var(--orange); }

/* ---------- Foyda/zarar natija kartasi ---------- */
.result-card { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); }
.result-card.profit { background: var(--green-soft); border-color: var(--green); }
.result-card.loss { background: var(--red-soft); border-color: var(--red); }
.result-card .label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.result-card .big { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.result-card.profit .big { color: var(--green); } .result-card.loss .big { color: var(--red); }
.result-card .ico { width: 36px; height: 36px; }
/* To'lov tugmalari — semizroq */
.pos.full .pay { min-width: 150px; padding: 14px 18px; font-size: 15px; font-weight: 700; }
.pos.full .pay .ico { width: 20px; height: 20px; }
.pos.full .pay small { font-size: 11px; }
/* To'lov tugmalari — kub (kvadrat) shakl */
.pos.full .pay { flex-direction: column; justify-content: center; gap: 6px; width: 118px; height: 118px; min-width: 118px; padding: 10px; border-radius: 12px; font-size: 14px; line-height: 1.2; text-align: center; }
.pos.full .pay .ico { width: 28px; height: 28px; }
.pos.full .pay span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos.full .pay small { font-size: 11px; opacity: .75; }
/* Kub tugmalar — kichikroq */
.pos.full .pay { width: 92px; height: 92px; min-width: 92px; padding: 8px; font-size: 12.5px; gap: 4px; border-radius: 10px; }
.pos.full .pay .ico { width: 22px; height: 22px; }
.pos.full .pay small { font-size: 10px; }
.pos.full .pay span { white-space: normal; overflow: visible; line-height: 1.15; }
/* Kub tugmalar — yana kichikroq */
.pos.full .pay { width: 78px; height: 78px; min-width: 78px; padding: 6px; font-size: 11.5px; gap: 3px; }
.pos.full .pay .ico { width: 18px; height: 18px; }
.pos.full .pay small { font-size: 9.5px; }
.pos.full .pay span { overflow-wrap: anywhere; }

/* Savat qatori: − miqdor + o'rtada */
.pos.full .cart-line { grid-template-columns: 1fr 170px 130px 130px 32px; }
.pos.full .cart-header { grid-template-columns: 1fr 170px 130px 130px 32px; }
.pos.full .cart-header span:nth-child(2) { text-align: center; }
.qty-ctl { display: flex; align-items: center; justify-content: center; gap: 4px; }
.qty-ctl input { width: 72px; text-align: center; }
.qty-ctl .btn { width: 30px; height: 30px; padding: 0; border-radius: 50%; }
/* Miqdor (− +) o'rtaroqda */
.pos.full .cart-line { grid-template-columns: 1.2fr 190px 1fr 140px 32px; }
.pos.full .cart-header { grid-template-columns: 1.2fr 190px 1fr 140px 32px; }
.pos.full .cart-line input[title] { width: 120px; margin-left: auto; }
/* Jadval: raqamli ustun sarlavhasi ham qiymat kabi o'ngda; markaziy ustunlar */
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.center, .tbl td.center { text-align: center; }
.tbl td.num .pill { justify-content: flex-end; }
.tbl th:last-child:empty { width: 1%; }
.card-head input[type="date"], .card-head select { width: auto; }
.card-head h2, .card-head h3 { white-space: nowrap; }

/* Chek print maydoni ekranda ko'rinmaydi — faqat qog'ozga */
@media screen { #print-area { position: fixed; left: -10000px; top: 0; width: 58mm; opacity: 0; pointer-events: none; } }
