:root {
  /* Oq + yashil mavzu (egasi tanlagan 2-dizayn, 2026-10-31): yozuvlar o'rtacha qalin. */
  --bg: #eef1f4; --panel: #ffffff; --panel2: #f3f5f7; --line: #dde2e8; --text: #111827; --muted: #4b5563;
  --accent: #15803d; --accent-ink: #ffffff; --green: #15803d; --red: #c62828; --blue: #1d4ed8; --yellow: #a16207;
  --r: 16px; --gap: 12px;
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-size: 18px; font-weight: 600; line-height: 1.5; letter-spacing: .25px; -webkit-tap-highlight-color: transparent; user-select: none; }
input, select, textarea { user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 16px; }
h2 { margin: 0 0 12px; font-size: 21px; }
h3 { margin: 0 0 10px; font-size: 18px; color: var(--muted); font-weight: 700; }
h2 { font-weight: 800; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }

.btn { padding: 11px 16px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); font-weight: 700; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #9aa3ae; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800; }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); font-weight: 800; }
.btn.red { background: #fff; color: var(--red); border-color: #f1b7b7; }
.btn.big { padding: 16px 20px; font-size: 20px; }
.btn.sm { padding: 6px 10px; font-size: 15px; border-radius: 8px; }

/* ---- yuqori panel ---- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; background: var(--panel); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.brand img { width: 26px; height: 26px; }
.brand img.logo { width: auto; height: 40px; max-width: 120px; object-fit: contain; border-radius: 8px; }
.login-logo { max-width: 160px; max-height: 120px; object-fit: contain; }
.logo-up { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 140px; height: 140px; border: 2px dashed var(--line); border-radius: 16px; display: grid; place-items: center; background: var(--panel2); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; order: 3; width: 100%; padding: 4px 2px 6px; scroll-behavior: auto; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; } /* katta shriftda bo'limlar ikkinchi qatorda, hammasi ko'rinadi */
/* Bo'limlar katakcha (tugma) ko'rinishida: har biri alohida ramkali quti, tanlangani to'q yashil. */
.tab { flex: none; padding: 10px 16px; border-radius: 12px; color: #1f2937; font-weight: 700; white-space: nowrap;
  background: var(--panel2); border: 2px solid var(--line); box-shadow: 0 1px 2px rgba(17,24,39,.06); transition: background .15s, border-color .15s; }
.tab:active { transform: scale(.97); }
.tab:hover:not(.on) { border-color: #9aa3ae; background: #fff; }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 2px 6px rgba(21,128,61,.3); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--muted); font-size: 15px; white-space: nowrap; }
.shift-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--red); margin-right: 4px; }
.shift-dot.on { background: var(--green); }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }

/* ---- kirish ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-box h1 { margin: 10px 0 4px; font-size: 31px; }
.dots { display: flex; justify-content: center; gap: 12px; margin: 24px 0; height: 16px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.f { background: var(--accent); border-color: var(--accent); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { height: 64px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); font-size: 28px; font-weight: 700; }
.pad button:active { background: var(--panel2); }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; }
.form { display: grid; gap: 12px; text-align: left; }

/* ---- zal ---- */
.zones { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { padding: 10px 18px; border-radius: 999px; border: 2px solid #d7dce2; background: #fff; color: #1f2937; font-weight: 700; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.table { aspect-ratio: 1.1; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); padding: 12px; display: flex; flex-direction: column; text-align: left; position: relative; }
.table .tn { font-size: 26px; font-weight: 800; }
.table .ts { color: var(--muted); font-size: 15px; margin-top: auto; }
.table.busy { border-color: var(--accent); background: #f0fdf4; }
.table.busy .tt { font-size: 20px; font-weight: 600; color: var(--accent); }
.badge { position: absolute; top: 10px; right: 10px; font-size: 13px; font-weight: 600; padding: 3px 7px; border-radius: 999px; }
.badge.ready { background: var(--green); color: #fff; }
.badge.unsent { background: #fde68a; color: #713f12; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 18px; }
.olist { display: grid; gap: 8px; margin-top: 10px; }
.oitem { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; text-align: left; width: 100%; }

/* ---- buyurtma ---- */
.order { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; height: calc(100vh - 150px); }
.menu-side { display: flex; flex-direction: column; min-height: 0; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; flex-wrap: wrap; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; overflow-y: auto; align-content: start; padding: 4px 2px 20px; }
.item { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; font-weight: 700; box-shadow: 0 1px 2px rgba(17,24,39,.06); padding: 14px; min-height: 100px; display: flex; flex-direction: column; text-align: left; gap: 10px; line-height: 1.35; }
.item:active { background: var(--panel2); transform: scale(.98); }
.item { min-width: 0; height: 122px; min-height: 0; overflow: hidden; } /* hamma taom tugmasi bir xil */
.item > span:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* nom ko'pi bilan 2 qator */
.item .p { white-space: nowrap; flex-shrink: 0; } /* narx doim to'liq ko'rinadi */
.item .p { margin-top: auto; align-self: flex-start; padding: 3px 9px; border-radius: 8px; background: #f0fdf4; color: #166534; font-weight: 800; }
.ticket { background: var(--panel); border: 2px solid var(--line); overflow: hidden; border-radius: var(--r); display: flex; flex-direction: column; min-height: 0; }
.ticket-head { padding: 10px 16px; background: #111827; color: #fff; }
.ticket-head .muted { color: #d1d5db; }
.ticket-head .t { font-size: 24px; font-weight: 800; }
.lines { overflow-y: auto; flex: 1; padding: 6px 0; }
.ln { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 13px 16px; border-bottom: 2px solid #f1f3f5; }
.ln .nm { font-weight: 700; }
.ln .sub { font-size: 15px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ln .sum { font-weight: 800; text-align: right; }
.ln.void .nm, .ln.void .sum { text-decoration: line-through; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 2px solid var(--line); font-size: 22px; font-weight: 800; }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }
.qty .qin { width: 64px; padding: 6px 4px; text-align: center; font-weight: 800; font-size: 17px; }
.mdest { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.mdest > div { background: var(--panel2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; align-content: start; }
.mdest b { font-size: 18px; }
.addq-l { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); white-space: nowrap; }
.addq-l input { width: 84px; padding: 9px 8px; text-align: center; font-weight: 800; font-size: 17px; }
.st { font-size: 13px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel2); }
.st.yangi { background: #fef3c7; color: #78350f; }
.st.oshxonada { background: #dbeafe; color: #1e3a8a; }
.st.tayyor { background: #dcfce7; color: #14532d; }
.totals { padding: 14px 16px; border-top: 2px solid var(--line); background: #f8fafb; display: grid; gap: 8px; }
.totals .tot { font-size: 35px; font-weight: 800; }
.acts { background: #f8fafb; padding: 10px 14px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acts .btn { white-space: normal; min-width: 0; padding: 9px 6px; font-size: 14px; line-height: 1.25; }
.acts .btn.big { padding: 14px 10px; font-size: 19px; }
.acts .wide { grid-column: 1 / -1; padding: 12px 10px; font-size: 17px; }
.acts .btn.big { padding: 14px 10px; font-size: 19px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---- oshxona ---- */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.tk { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.tk-h { padding: 10px 14px; display: flex; align-items: center; gap: 8px; background: var(--panel2); }
.tk-h b { font-size: 21px; }
.tk.warn { border-color: var(--yellow); }
.tk.late { border-color: var(--red); }
.tk.late .tk-h { background: #fee2e2; }
.tk-l { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 2px solid #f1f3f5; font-weight: 700; width: 100%; text-align: left; font-size: 20px; }
.tk-l .q { font-weight: 800; color: var(--accent); min-width: 34px; }
.tk-l.done { color: var(--muted); text-decoration: line-through; }
.tk-l .nt { display: block; font-size: 15px; color: var(--yellow); }
.tk .btn { margin: 10px 14px 14px; width: calc(100% - 28px); }

/* ---- hisobot va sozlamalar ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi .v { font-size: 31px; font-weight: 800; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 12px 10px; border-bottom: 1px solid #e5e8ec; text-align: left; }
table.t th { color: var(--muted); font-weight: 700; font-size: 15px; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 44px 1fr 90px; gap: 8px; align-items: center; font-size: 15px; }
.bar i { display: block; height: 14px; border-radius: 4px; background: var(--accent); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-items: end; }
.list-edit { display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.list-edit .r { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.off { opacity: .5; }

/* ---- oyna va xabar ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; padding: 20px; }
.modal.wide { max-width: 640px; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.methods button { padding: 14px 6px; border-radius: 10px; background: var(--bg); border: 2px solid var(--line); font-weight: 600; }
.methods button.on { border-color: var(--accent); color: var(--accent); }
.quick-sums { display: flex; gap: 6px; flex-wrap: wrap; }
.paybig { font-size: 35px; font-weight: 700; }
.change { font-size: 26px; font-weight: 700; color: var(--green); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--red); color: #fff; }
#print { display: none; }

@media (max-width: 900px) {
  .order { grid-template-columns: 1fr; height: auto; }
  .items { max-height: 50vh; }
  .ticket { min-height: 420px; }
  main { padding: 12px; }
}

/* ---- chek (80 mm termoprinter) ---- */
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body { background: #fff; color: #000; }
  body > *:not(#print) { display: none !important; }
  /* Termal printerda xira chiqmasligi uchun hamma yozuv qalin va qora, sans shriftda. */
  #print { display: block; font-family: -apple-system, "SF Pro Display", "SF Pro Text", "Segoe UI", Arial, sans-serif; font-size: 18px; font-weight: 500; border: 2px solid #000; border-radius: 12px; padding: 10px 12px; box-sizing: border-box; line-height: 1.35; width: 72mm; color: #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print * { color: #000 !important; }
  #print .c { text-align: center; }
  #print .b { font-weight: 700; }
  #print .big { font-size: 26px; font-weight: 800; }
  #print hr { border: 0; border-top: 2px dashed #000; margin: 6px 0; }
  #print .r { display: flex; justify-content: space-between; gap: 6px; }
}

/* til tanlash */
.langs { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.langs button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line, #2a2f37); background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.langs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.who .langs { margin-top: 0; }
.who .langs button { padding: 4px 7px; font-size: 14px; }

/* bekor qilish sababi va xodim */
.void-why { color: var(--red); font-size: 14px; }

/* ---- telefon: pastki menyu, ixcham stollar, chekka tez o'tish ---- */
.to-ticket { display: none; }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 6px 10px; gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); }
  .brand { font-size: 16px; margin-right: 0; min-width: 0; }
  .brand img { width: 24px; height: 24px; }
  /* Telefonda xodim ismi ham ko'rinadi: sarlavhaning ikkinchi qatorida, uzun bo'lsa qisqartiriladi. */
  .who { gap: 6px; flex: 1 1 100%; margin-left: 0; min-width: 0; max-width: 100%; }
  .who .nm .rl { display: none; }
  .who .nm { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 700; font-size: 15px; }
  .who > span[title="Smena"] { font-size: 0; }
  .who > span[title="Smena"] .shift-dot { margin: 0; }
  .who .langs button { padding: 3px 5px; font-size: 13px; }
  .who .btn.sm { padding: 5px 8px; font-size: 14px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--panel); border-top: 1px solid var(--line);
    justify-content: flex-start; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); gap: 6px; }
  .tab { padding: 10px 12px; font-size: 15px; flex: 1 0 auto; min-width: 76px; text-align: center; }
  main { padding: 10px 10px 90px; }
  .tables { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .table { aspect-ratio: 1; padding: 8px; border-radius: 12px; }
  .table .tn { font-size: 20px; }
  .table .ts { font-size: 13px; }
  .table.busy .tt { font-size: 16px; }
  .badge { top: 6px; right: 6px; font-size: 11px; padding: 2px 5px; }
  .quick { grid-template-columns: 1fr; margin-bottom: 12px; }
  .order > * { min-width: 0; }
  .hide-sm { display: none; }
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cat-chips .chip { white-space: nowrap; flex: none; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item { height: 110px; padding: 10px; gap: 6px; }
  .tab { font-size: 14px; padding: 10px 10px; min-width: 70px; }
  .cats { flex-wrap: nowrap; scrollbar-width: none; }
  .cats .chip { white-space: nowrap; flex: none; }
  .items { max-height: none; padding-bottom: 150px; } /* oxirgi qator pastdagi "Chek" tugmasi ostida qolmasin */
  .ticket { min-height: 0; scroll-margin-top: 60px; }
  .to-ticket { display: flex; position: fixed; left: 10px; right: 10px; bottom: 70px; z-index: 6; justify-content: space-between; align-items: center;
    padding: 14px 16px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 6px 20px rgba(17,24,39,.25); }
  .modal { max-height: 92vh; overflow: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  table.t { font-size: 15px; }
  .card { padding: 12px; overflow-x: auto; }
}

/* ilovani o'rnatish */
.install { margin-top: 14px; width: 100%; }
.install-ios { font-size: 14px; margin: 14px 0 0; }

/* omborda kam qolganlar: yig'ilgan holda, bosilganda ochiladi */
.low-box { margin-bottom: 14px; border-color: #f1b7b7; }
.low-box summary { cursor: pointer; list-style: none; }
.low-box summary::-webkit-details-marker { display: none; }
.low-box summary::after { content: ' ▾'; color: var(--muted); }
.low-box[open] summary::after { content: ' ▴'; }
.low-list { margin: 10px 0 0; font-size: 15px; line-height: 1.5; max-height: 40vh; overflow: auto; }

/* ombor jadvali: kategoriya sarlavhasi */
.stock-t .cat-row td { background: var(--panel2); font-weight: 600; padding-top: 10px; padding-bottom: 10px; border-top: 2px solid var(--line); }
.low-box .stock-t { margin-top: 10px; }
.low-box { max-height: none; }

.qr-box { background: #fff; padding: 12px; border-radius: 12px; width: min(260px, 70vw); margin: 8px auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.item.stopped { opacity: .45; text-decoration: line-through; }
.item.stopped .p { color: var(--red); text-decoration: none; }
.stop-list h3 { margin: 12px 0 6px; font-size: 16px; color: var(--muted); }
.opts { font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.cust-box { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px; display: grid; gap: 6px; }
.opt-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
.table.booked { border-color: #6d5bd0; }
.badge.bron { background: #ede9fe; color: #4c1d95; }
.badge.qr { background: var(--accent); color: var(--accent-ink); }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-card { display: grid; gap: 4px; justify-items: center; text-align: center; }
.qr-card .qr-box { width: 140px; }
@media print { .qr-print { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .qr-print .qr-card { break-inside: avoid; } .qr-print .qr-box { width: 160px; } }
.table:has(.badge) { padding-top: 28px; }
.card:has(> table.t) { overflow-x: auto; }

/* ---- ekran klaviaturasi (vk.js) ---- */
#vk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #1f2937; padding: 10px; display: grid; gap: 6px; box-shadow: 0 -6px 24px rgba(0,0,0,.35); user-select: none; }
#vk[hidden] { display: none; }
.vk-row { display: flex; gap: 6px; justify-content: center; }
.vk-k { flex: 1 1 0; max-width: 84px; min-height: 52px; border-radius: 10px; background: #fff; color: #111827; font-size: 20px; font-weight: 800; padding: 0; }
.vk-k:active { background: #d1d5db; }
.vk-fn { background: #4b5563; color: #fff; }
.vk-ok { background: var(--accent); color: #fff; max-width: 150px; flex-grow: 1.5; }
.vk-on { background: var(--accent); color: #fff; }
.vk-w { max-width: 120px; flex-grow: 1.5; }
.vk-space { flex: 4 1 0; max-width: none; font-size: 16px; }
.vk-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 420px; margin: 0 auto; width: 100%; }
.vk-num .vk-k { max-width: none; min-height: 58px; font-size: 28px; }
.vk-t.on { background: var(--accent); color: #fff; border-color: var(--accent); }
body.vk-open { padding-bottom: 360px; }
body.vk-open .modal-bg { padding-bottom: 360px; }
body.vk-open .modal { max-height: calc(100vh - 390px); overflow: auto; }
@media print { #vk { display: none !important; } }

/* Qo'shimcha amallar guruhi: katta ekranda oddiy ko'rinadi, past ekranda "Yana" tugmasi ostida yig'iladi. */
.acts-more { display: contents; }
.acts-toggle { display: none; }
/* Past (kam balandlikdagi) kassa ekrani: buyurtma paneli ichida taomlar ro'yxati kamida 3 qator ko'rinsin, gorizontal siljish bo'lmasin. */
.ticket { overflow-y: auto; overflow-x: hidden; }
.lines { flex: 1 0 170px; overflow-x: hidden; }
.ln { min-width: 0; }
.ln > * { min-width: 0; }
.ln .sub { flex-wrap: wrap; }
@media (min-width: 901px) and (max-height: 860px) {
  .order { height: calc(100vh - 130px); }
  .ticket-head { padding: 6px 14px; }
  .ticket-head .t { font-size: 20px; }
  .ln { padding: 8px 12px; gap: 4px 10px; }
  .lines { flex-basis: 120px; padding: 2px 0; }
  .ln .sub .btn.sm { padding: 3px 7px; font-size: 12px; }
  .ln .nm { line-height: 1.2; }
  .cats { gap: 6px; padding-bottom: 4px; }
  /* Menyu tomoni: toifa tugmalari bir qatorda (yon tomonga siljiydi), taom kartochkalari past: ko'proq taom bir ekranda ko'rinadi. */
  .cats { flex-wrap: nowrap; scrollbar-width: none; }
  .cats .chip { white-space: nowrap; flex: none; padding: 6px 14px; font-size: 15px; }
  .menu-side > .row { margin-bottom: 6px !important; }
  .items { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; padding-bottom: 8px; }
  .item { height: 84px; padding: 8px 10px; gap: 4px; font-size: 16px; }
  .item .p { padding: 1px 8px; font-size: 15px; }
}

/* Kassa sensorli ekranida tasodifan ikki barmoq bilan bosilsa sahifa kattalashib, o'ng-chap chetlari kesilib qolardi: kattalashtirish o'chirildi. */
html, body { touch-action: pan-x pan-y; overflow-x: hidden; }
.menu-side > .row, .cats { flex-shrink: 0; } /* toifa tugmalari menyu kartochkalari ostida kesilib qolmasin */
.ln.void { padding: 4px 16px; opacity: .65; }
.ln.void .nm { font-size: 14px; }
.ln.void .sub { font-size: 12px; }
/* Toifa tugmalari ko'p bo'lsa chap tomon kengayib, tapshiriq paneli (to'lov) ekrandan chiqib ketmasin. */
.menu-side { min-width: 0; }
.cats { min-width: 0; max-width: 100%; }
/* Ekran past bo'lib panel siljisa ham "To'lov" tugmasi pastda ko'rinib turadi. */
.acts .btn.green.big { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -6px 10px -4px rgba(248, 250, 251, .95); }
/* Buyurtma sarlavhasidagi "Ma'lumot" tugmasi: oq fonda oq yozuv ko'rinmay, bo'sh quti bo'lib turardi. */
.ticket-head .btn { color: var(--text); background: #fff; }

/* Kassa ekrani: tapshiriq yozilayotgan taomlar ro'yxati eng katta joyni egallaydi, qolgan (sarlavha, jami, tugmalar) ixcham. */
@media (min-width: 901px) and (max-height: 960px) {
  .ticket-head { padding: 4px 12px; }
  .ticket-head .t { font-size: 18px; }
  .ticket-head .muted { font-size: 13px !important; margin-top: 0 !important; }
  .ticket-head .btn.sm { padding: 2px 8px; font-size: 12px; }
  .lines { flex: 1 1 auto; min-height: 150px; }
  .ln { padding: 5px 12px; gap: 2px 10px; }
  .ln .sub { gap: 6px; }
  .totals { padding: 3px 12px; gap: 0; }
  .totals .tot { font-size: 22px; }
  .acts { padding: 4px 8px 6px; gap: 4px; }
  .acts .btn { padding: 3px 2px; font-size: 11px; line-height: 1.1; min-height: 28px; }
  .acts .wide { padding: 5px 6px; font-size: 13px; min-height: 0; }
  .acts .btn.green.big { padding: 8px 6px; font-size: 16px; min-height: 40px; }
}

/* ⋯ menyu (Tahrirlash / O'chirish) */
.kebab { position: relative; display: inline-block; }
.kebab > .kb { min-width: 40px; height: 36px; padding: 0 10px; border-radius: 10px; font-size: 22px; line-height: 1; font-weight: 800; color: var(--muted); border: 1px solid var(--line); background: var(--panel); }
.kmenu { position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 80; min-width: 170px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.kmenu[hidden] { display: none; }
.kmenu button { display: block; width: 100%; text-align: left; padding: 12px 16px; font-size: 17px; font-weight: 700; border-bottom: 1px solid var(--line); }
.kmenu button:last-child { border-bottom: 0; }
.kmenu button.red { color: var(--red); }
.lm { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.lm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }

/* Bekor qilish sabablari (otmen): tayyor tanlov */
.rsn-list { display: grid; gap: 8px; margin-bottom: 10px; }
.rsn { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; font-size: 18px; font-weight: 700; background: var(--panel); cursor: pointer; }
.rsn input { width: 22px; height: 22px; padding: 0; flex: none; accent-color: var(--red); }
.rsn:has(input:checked) { border-color: var(--red); background: #fdecec; }

/* ---------- Zal 3D ---------- */
.z3d-tg { margin-left: auto; }
.z3d { --sc: 1; --rx: 56deg; --rz: -30deg; position: relative; height: clamp(360px, 62vh, 660px); border-radius: 18px; overflow: hidden; perspective: 1700px;
  background: radial-gradient(120% 90% at 50% 20%, #3a4553 0%, #1b222b 60%, #11161c 100%); box-shadow: inset 0 0 80px rgba(0,0,0,.45); }
.z3d.flat { --rx: 0deg; --rz: 0deg; }
.z3-scene { position: absolute; left: 50%; top: 60%; transform-style: preserve-3d;
  transform: translate(-50%, -50%) scale(var(--sc)) rotateX(var(--rx)) rotateZ(var(--rz)); transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.z3-scene * { transform-style: preserve-3d; }
.z3-floor { position: absolute; inset: 0; border-radius: 6px; box-shadow: 0 30px 60px rgba(0,0,0,.5);
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 120px),
              repeating-linear-gradient(0deg, #6d7782 0 21px, #5f6873 21px 22px, #737d88 22px 43px, #5c6570 43px 44px); }
.z3-wall { position: absolute; background: linear-gradient(#f3f0ea, #e3ddd2); }
.z3-wall.left { left: 0; top: 0; width: 1000px; height: 150px; transform-origin: top; transform: rotateX(90deg); display: flex; justify-content: space-around; align-items: flex-start; padding: 22px 110px 0 60px; box-sizing: border-box; }
.z3-wall.left .arch { position: relative; width: 96px; height: 120px; border-radius: 48px 48px 6px 6px; background: linear-gradient(#e2b483, #c58e58);
  box-shadow: 0 0 0 4px #f8e7cf, 0 0 26px 6px rgba(255,205,140,.55); transform: scaleY(-1); }
.z3-wall.left .arch i { position: absolute; left: 30px; top: 22px; width: 36px; height: 60px; border-radius: 4px; background: repeating-linear-gradient(90deg, #f6efe2 0 3px, #d9c3a2 3px 6px); opacity: .9; }
.z3-wall.back { left: 1000px; top: 0; width: 150px; height: 440px; transform-origin: left; transform: rotateY(-90deg); background: linear-gradient(90deg, #e9e4da, #d8d1c4); }
.z3-glass { position: absolute; left: 0; top: 440px; width: 1000px; height: 70px; transform-origin: top; transform: rotateX(90deg); display: flex; justify-content: space-between;
  background: linear-gradient(rgba(150,200,245,.10), rgba(170,215,255,.32)); border-bottom: 4px solid #47505a; box-sizing: border-box; }
.z3-glass i { width: 4px; height: 100%; background: #47505a; }
.cb { position: absolute; transform: translateZ(var(--z)); }
.cb .f { position: absolute; display: block; }
.cb .t { inset: 0; transform: translateZ(var(--h)); background: var(--c1); border-radius: 3px; }
.cb .s1 { left: 0; bottom: 0; width: 100%; height: var(--h); transform-origin: bottom; transform: rotateX(-90deg); background: var(--c2); }
.cb .s2 { left: 0; top: 0; width: 100%; height: var(--h); transform-origin: top; transform: rotateX(90deg); background: var(--c3); }
.cb .s3 { left: 0; top: 0; width: var(--h); height: 100%; transform-origin: left; transform: rotateY(-90deg); background: var(--c3); }
.cb .s4 { right: 0; top: 0; width: var(--h); height: 100%; transform-origin: right; transform: rotateY(90deg); background: var(--c2); }
.cb.col.flute { --c2: repeating-linear-gradient(90deg, #f1efe9 0 5px, #c9c5bc 5px 7px); --c3: repeating-linear-gradient(90deg, #e2dfd8 0 5px, #bdb9b0 5px 7px); }
.cb.col { --c1: #f4f4f2; --c2: repeating-linear-gradient(90deg, #e4e2dc 0 4px, #cfccc4 4px 6px); --c3: repeating-linear-gradient(90deg, #d8d5ce 0 4px, #c2bfb7 4px 6px); }
.cb.bar { --c1: #c9a06a; --c2: #f7f6f2; --c3: #e6e3dc; }
.cb.shelf { --c1: #3b3f45; --c2: repeating-linear-gradient(0deg, #2d3136 0 28px, #8a6a42 28px 31px), radial-gradient(circle, #c33 2px, transparent 3px) 0 0/18px 28px; --c3: #24282d; }
.cb.ac { --c1: #f5f7f8; --c2: linear-gradient(#fff 0 70%, #cfd6db 70%); --c3: #e3e8eb; }
.cb.chair { --c1: #3f7d55; --c2: #326645; --c3: #2a5739; }
.cb.chair.rust { --c1: #b8572f; --c2: #9b4626; --c3: #843b20; }
.cb.chair.grey { --c1: #c9c6c0; --c2: #b0ada7; --c3: #9d9a94; }
.cb.coffee { --c1: #c62828; --c2: #a61f1f; --c3: #8e1b1b; }
.cb.vitrina { --c1: rgba(220,240,255,.7); --c2: linear-gradient(rgba(230,245,255,.75), rgba(190,215,235,.75)); --c3: rgba(200,225,240,.7); }
.cb.sofa { --c1: #2f4f9e; --c2: #284487; --c3: #213a74; }
.cb.top { --c1: linear-gradient(135deg, #e9c27e, #d4a55c); --c2: #b98a45; --c3: #a77a3a; }
.cb.top.busy { --c1: linear-gradient(135deg, #f59e0b, #ea580c); }
.cb.top.ready { --c1: linear-gradient(135deg, #22c55e, #15803d); }
.cb.top.booked { --c1: linear-gradient(135deg, #60a5fa, #2563eb); }
.z3-plant { position: absolute; width: 0; height: 0; transform: translateZ(var(--z)); }
.z3-plant::before { content: ''; position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7fc06f, #2f6b33 70%); transform: rotateZ(calc(-1 * var(--rz))) rotateX(calc(-1 * var(--rx))); }
.z3-lamp { position: absolute; width: 0; height: 0; transform: translateZ(140px); }
.z3-lamp.ring span { width: 52px; left: -26px; background: radial-gradient(transparent 45%, #fff6d8 50%, #ffd27a 60%, transparent 70%); }
.z3-plant.big::before { left: -36px; top: -36px; width: 72px; height: 72px; }
.z3-lamp span { position: absolute; left: -34px; top: -10px; width: 68px; height: 20px; border-radius: 50%;
  background: radial-gradient(#fff8e1, #ffd27a 60%, transparent 72%); box-shadow: 0 0 40px 14px rgba(255,214,130,.45);
  transform: rotateZ(calc(-1 * var(--rz))) rotateX(calc(-1 * var(--rx))); animation: z3sway 5s ease-in-out var(--d) infinite; }
@keyframes z3sway { 0%,100% { translate: 0 0; } 50% { translate: 4px -3px; } }
.z3-t { position: absolute; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.z3-t.drop { animation: z3drop .7s cubic-bezier(.2,1.3,.4,1) backwards; animation-delay: calc(var(--i) * 60ms); }
@keyframes z3drop { from { transform: translateZ(180px); } to { transform: translateZ(0); } }
.z3-t:hover .cb.top, .z3-t:focus-visible .cb.top { --z: 8px; }
.z3-t .cb.top { transition: transform .25s; }
.z3-lb { position: absolute; left: 0; top: 0; transform: translateZ(78px) rotateZ(calc(-1 * var(--rz))) rotateX(calc(-1 * var(--rx))) translate(-50%, -100%);
  background: rgba(255,255,255,.95); color: #111827; border-radius: 10px; padding: 5px 10px; font-size: 15px; line-height: 1.15; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: none; transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.z3-lb b { font-size: 17px; } .z3-lb small { color: #4b5563; font-size: 12px; }
.z3-t.busy .z3-lb { background: #fff7ed; outline: 2px solid #ea580c; } .z3-t.ready .z3-lb { background: #f0fdf4; outline: 2px solid #15803d; animation: z3pulse 1.4s infinite; }
.z3-t.booked .z3-lb { background: #eff6ff; outline: 2px solid #2563eb; }
@keyframes z3pulse { 50% { box-shadow: 0 0 0 8px rgba(34,197,94,.35); } }
.z3d.flat .z3-t { cursor: grab; } .z3-t.drag { cursor: grabbing; z-index: 5; }
.z3-legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.z3-legend .lg { color: #fff; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.z3-legend .lg::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: #d4a55c; }
.z3-legend .busy::before { background: #ea580c; } .z3-legend .ready::before { background: #15803d; } .z3-legend .booked::before { background: #2563eb; }
.z3-tools { position: absolute; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; }
.z3-tools .muted { color: #e5e7eb; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .z3-scene, .z3-lb { transition: none; } .z3-t.drop, .z3-lamp span, .z3-t.ready .z3-lb { animation: none; } }
/* Naqd to'lovda qaytim: katta va aniq */
.qaytim { display: none; margin-top: 10px; padding: 12px 16px; border-radius: 12px; align-items: center; justify-content: space-between; }
.qaytim span { font-size: 18px; font-weight: 600; }
.qaytim b { font-size: 34px; font-weight: 800; }
.qaytim.on { display: flex; background: #f0fdf4; border: 2px solid var(--green); color: var(--green); }
.qaytim.ok { display: flex; background: var(--panel2); border: 2px solid var(--line); color: var(--muted); }
.qaytim.ok b { font-size: 20px; }
.qaytim.kam { display: flex; background: #fef2f2; border: 2px solid var(--red); color: var(--red); }

/* Menyu bo'limlari (toifalar): kompyuter/planshetda chap tomonda katta tugmalar ustuni, tepaga-pastga suriladi. Telefonda avvalgidek tepada qator. */
@media (min-width: 901px) {
  .menu-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px; flex: 1; min-height: 0; }
  .menu-body .cats { flex-direction: column; flex-wrap: nowrap; gap: 8px; overflow-y: auto; overflow-x: hidden; padding: 2px 4px 20px 0;
    scrollbar-width: thin; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; min-height: 0; }
  .menu-body .cats .chip { width: 100%; flex: none; text-align: left; white-space: normal; line-height: 1.2;
    padding: 16px 14px; font-size: 18px; border-radius: 14px; min-height: 60px; }
  .menu-body .items { min-height: 0; }
}
@media (min-width: 901px) and (max-height: 860px) {
  .menu-body .cats .chip { padding: 12px 12px; font-size: 16px; min-height: 50px; }
}
/* Taom kartochkalari: egasi ko'rsatgan namunadek katta (oq kartochka, qalin katta nom, ostida yashil narx), past ekranda ham kichraymaydi. */
@media (min-width: 901px) {
  .menu-body .items { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding-bottom: 20px; }
  .menu-body .items .item { height: 122px; padding: 14px 16px; gap: 10px; font-size: 19px; line-height: 1.3; border-radius: 16px; }
  .menu-body .items .item .p { padding: 4px 12px; font-size: 18px; border-radius: 10px; }
}

/* Ikhlas: rangli menyu. Har bo'lim o'z rangida (--h), taom kartochkasi shu bo'lim rangida och fon, chap tomonda rangli chiziq, narx shu rangda. */
.menu-body.rangli .cats .chip { background: hsl(var(--h) 70% 96%); border: 2px solid hsl(var(--h) 45% 82%); border-left: 9px solid hsl(var(--h) 58% 48%); color: hsl(var(--h) 45% 22%); }
.menu-body.rangli .cats .chip.on { background: hsl(var(--h) 55% 40%); border-color: hsl(var(--h) 55% 34%); color: #fff; box-shadow: 0 4px 12px hsl(var(--h) 50% 40% / .35); }
.menu-body.rangli .items .item { background: linear-gradient(160deg, hsl(var(--h) 75% 97%), #fff 70%); border: 2px solid hsl(var(--h) 40% 86%); border-left: 8px solid hsl(var(--h) 58% 50%);
  box-shadow: 0 2px 6px hsl(var(--h) 40% 40% / .10); color: hsl(var(--h) 35% 16%); }
.menu-body.rangli .items .item:active { background: hsl(var(--h) 70% 92%); }
.menu-body.rangli .items .item .p { background: hsl(var(--h) 65% 90%); color: hsl(var(--h) 60% 24%); }
.menu-body.rangli .items .item.stopped { background: #f3f4f6; border-left-color: #9ca3af; }
/* "Eng ko'p sotilgan" bo'limi: oltin rangda, boshqalardan ajralib turadi. */
.cats .chip.top { font-weight: 800; }
.menu-body .cats .chip.top:not(.on) { background: #fff8e1; border-color: #f5d27a; color: #7a5200; }
