/* =====================================================================
   KAFE POS — DIZAYN TIZIMI
   ===================================================================== */

:root {
  --brand:        #6D5BD0;
  --brand-dark:   #5344ad;
  --brand-light:  #EEECFB;
  --ink:          #1D1B26;
  --ink-2:        #55536A;
  --ink-3:        #8B89A0;
  --line:         #E6E4F0;
  --bg:           #F5F4FA;
  --card:         #FFFFFF;
  --ok:           #14A870;
  --ok-bg:        #E4F6EE;
  --warn:         #E8961E;
  --warn-bg:      #FDF1DF;
  --danger:       #E0455A;
  --danger-bg:    #FCE9EC;
  --info:         #2F7BD8;
  --radius:       14px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(29,27,38,.06), 0 4px 16px rgba(29,27,38,.05);
  --shadow-lg:    0 8px 32px rgba(29,27,38,.14);
}

/* ---------- TUNGI REJIM ---------- */
[data-bs-theme="dark"] {
  --brand:        #8B7BE8;
  --brand-dark:   #A395F0;
  --brand-light:  #2A2540;
  --ink:          #E8E6F2;
  --ink-2:        #A8A5BD;
  --ink-3:        #7B7894;
  --line:         #302C42;
  --bg:           #16141F;
  --card:         #1E1B2A;
  --ok:           #35C68C;
  --ok-bg:        #16342A;
  --warn:         #F0A83A;
  --warn-bg:      #3A2C14;
  --danger:       #F0637A;
  --danger-bg:    #3A1E24;
  --shadow:       0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.45);
}
[data-bs-theme="dark"] .table thead th { background: #262233; }
[data-bs-theme="dark"] .table tbody tr:hover { background: #262233; }
[data-bs-theme="dark"] .table td { border-color: #2A2638; }
[data-bs-theme="dark"] .cart-foot { background: #1A1726; }
[data-bs-theme="dark"] .cat-chip { background: #2A2540; color: var(--ink-2); }
[data-bs-theme="dark"] .login-wrap { background: linear-gradient(160deg, #16141F 0%, #1E1B2A 100%); }
[data-bs-theme="dark"] .login-box { background: var(--card); }
[data-bs-theme="dark"] .login-right { background: #1A1726; }
[data-bs-theme="dark"] .sidebar,
[data-bs-theme="dark"] .topbar,
[data-bs-theme="dark"] .pos-topbar,
[data-bs-theme="dark"] .cart,
[data-bs-theme="dark"] .cat-bar,
[data-bs-theme="dark"] .bottom-nav { background: var(--card); }
[data-bs-theme="dark"] .table-card { background: var(--card); }
[data-bs-theme="dark"] .table-card.busy { background: #2A2314; }
[data-bs-theme="dark"] .table-card.billing { background: #2A1A1E; }
[data-bs-theme="dark"] .stat, [data-bs-theme="dark"] .card-x,
[data-bs-theme="dark"] .prod-card, [data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .numpad button, [data-bs-theme="dark"] .pay-btn,
[data-bs-theme="dark"] .qty-btn { background: var(--card); }
[data-bs-theme="dark"] .pin-display { background: var(--card); }
[data-bs-theme="dark"] .alert-info { background: #1B2A3A; border-color: #24405C; color: #9CC8F0; }
[data-bs-theme="dark"] .alert-light { background: #262233; border-color: var(--line); color: var(--ink); }

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #C9C6DC; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

a { text-decoration: none; }

/* ---------- Umumiy elementlar ---------- */
.card-x {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-title { font-size: 22px; font-weight: 600; margin: 0; }
.muted { color: var(--ink-3); }
.hint  { font-size: 13px; color: var(--ink-3); }

.btn { border-radius: var(--radius-sm); font-weight: 500; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-soft { background: var(--brand-light); color: var(--brand-dark); border: none; }
.btn-soft:hover { background: #E2DFF8; color: var(--brand-dark); }
.btn-lg-touch { padding: 14px 22px; font-size: 17px; border-radius: 12px; }

.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); padding: 10px 13px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109,91,208,.13); }
.form-label { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }

.badge-soft      { background: var(--brand-light); color: var(--brand-dark); font-weight: 500; }
.badge-ok        { background: var(--ok-bg);      color: var(--ok); }
.badge-warn      { background: var(--warn-bg);    color: #A9670C; }
.badge-danger    { background: var(--danger-bg);  color: var(--danger); }
.badge-x { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; display: inline-block; }

.table > :not(caption) > * > * { padding: 12px 14px; }
.table thead th {
  background: #FAF9FE; color: var(--ink-2); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:hover { background: #FBFAFE; }
.table td { border-color: #F1EFF8; vertical-align: middle; }

.modal-content { border: none; border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--line); padding: 18px 22px; }
.modal-body    { padding: 22px; }
.modal-footer  { border-top: 1px solid var(--line); padding: 14px 22px; }

/* =====================================================================
   KIRISH SAHIFASI
   ===================================================================== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #F3F1FC 0%, #E9E6F9 100%); padding: 20px;
}
.login-box {
  width: 100%; max-width: 880px; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-lg); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr;
}
.login-left  { padding: 46px 40px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.login-right { padding: 40px 36px; background: #FBFAFE; border-left: 1px solid var(--line); }
.login-logo  { font-size: 40px; font-weight: 700; color: var(--brand); letter-spacing: -1px; }
.login-sub   { color: var(--ink-3); font-size: 14px; margin-top: 8px; line-height: 1.6; }

.pin-display {
  height: 58px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px;
}
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: .15s; }
.pin-dot.on { background: var(--brand); transform: scale(1.15); }

.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-key {
  height: 62px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink);
  font-size: 25px; font-weight: 600; transition: .12s;
  box-shadow: 0 1px 2px rgba(29,27,38,.05);
}
.pin-key:active  { transform: scale(.94); background: var(--brand-light); border-color: var(--brand); }
.pin-key.gray    { background: transparent; border-color: transparent; color: var(--ink-3); box-shadow: none; }
.pin-key.red     { background: transparent; border-color: transparent; color: var(--danger); box-shadow: none; }
.pin-key.gray:active, .pin-key.red:active { background: var(--line); }

.license-bar {
  border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 500; text-align: center;
}
.license-ok   { background: var(--ok-bg);     color: var(--ok); }
.license-warn { background: var(--warn-bg);   color: #A9670C; }
.license-bad  { background: var(--danger-bg); color: var(--danger); }

@media (max-width: 800px) {
  .login-box  { grid-template-columns: 1fr; max-width: 420px; }
  .login-left { padding: 32px 26px 8px; }
  .login-right{ border-left: none; }
}

/* =====================================================================
   ADMIN LAYOUT
   ===================================================================== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 252px; background: #fff;
  border-right: 1px solid var(--line); overflow-y: auto; z-index: 1040; transition: transform .22s;
}
.sidebar-brand {
  padding: 20px 22px; font-size: 19px; font-weight: 700; color: var(--brand);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
}
.sidebar-group {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px;
  color: var(--ink-3); padding: 16px 22px 6px;
}
.sidebar a.nav-x {
  display: flex; align-items: center; gap: 11px; padding: 10px 22px;
  color: var(--ink-2); font-size: 14.5px; border-left: 3px solid transparent;
}
.sidebar a.nav-x i { font-size: 17px; width: 20px; }
.sidebar a.nav-x:hover  { background: #FAF9FE; color: var(--brand-dark); }
.sidebar a.nav-x.active { background: var(--brand-light); color: var(--brand-dark); border-left-color: var(--brand); font-weight: 500; }

.main { margin-left: 252px; min-height: 100vh; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 1030;
}
.content { padding: 24px; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(29,27,38,.4); z-index: 1035; }
.sidebar-backdrop.show { display: block; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px; }
}

/* ---------- Statistik kartalar ---------- */
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); height: 100%;
}
.stat-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 6px; line-height: 1.15; }
.stat-icon  {
  width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}

/* =====================================================================
   POS / OFITSIANT
   ===================================================================== */
/* Kassa ekrani: sahifa umuman aylanmaydi, faqat ichidagi ro'yxatlar aylanadi.
   Aks holda mahsulotlarni aylantirmoqchi bo'lganda butun sahifa siljib,
   yuqoridagi tugmalar ko'rinmay qoladi. */
.pos-body { background: var(--bg); min-height: 100vh; }

/* =====================================================================
   BUYURTMA EKRANI

   Sahifaning o'zi umuman aylanmaydi. Faqat ikki joy aylanadi:
   mahsulotlar ro'yxati va savat.

   Buning uchun balandlik hisoblanmaydi — ekran qat'iy joylashtiriladi.
   Tepa panel 58px, qolgan hamma joy buyurtma ekraniga tegishli.
   ===================================================================== */
html.order-html, body.order-page {
  height: 100%;
  margin: 0;
  overflow: hidden !important;      /* butun sahifa aylanmaydi */
  overscroll-behavior: none;
}

body.order-page .pos-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 30;
}

.pos-topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  position: sticky; top: 0; z-index: 1030;
}
.pos-clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }

/* ---------- Stol kartalari ---------- */
.tables-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 13px; padding: 16px;
}
.table-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 12px; text-align: center; cursor: pointer; transition: .14s;
  box-shadow: var(--shadow); position: relative; min-height: 118px;
  display: flex; flex-direction: column; justify-content: center;
}
.table-card:active { transform: scale(.97); }
.table-card .t-name  { font-size: 24px; font-weight: 700; line-height: 1.1; }
.table-card .t-seats { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.table-card .t-sum   { font-size: 16px; font-weight: 600; color: var(--ok); margin-top: 7px; }
.table-card .t-meta  { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.table-card.free    { border-color: var(--line); }
.table-card.busy    { border-color: var(--warn); background: #FFFCF6; }
.table-card.billing { border-color: var(--danger); background: #FFF7F8; }
.table-card.reserved { border-color: var(--info); background: #F4F8FE; border-style: dashed; }
[data-bs-theme="dark"] .table-card.reserved { background: #17233A; }
.table-card .t-res-tag {
  position: absolute; top: 7px; left: 8px; color: var(--info); font-size: 13px;
}
.table-card .t-timer {
  position: absolute; top: 8px; right: 9px; font-size: 11px; font-weight: 600;
  background: var(--warn-bg); color: #A9670C; padding: 2px 7px; border-radius: 10px;
}

/* ---------- Buyurtma ekrani ---------- */
.order-layout {
  position: fixed;
  top: 58px;                        /* tepa panel balandligi */
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;

  /* Qator balandligi ham qat'iy bo'lishi SHART.
     Busiz qator mazmun bo'yicha cho'ziladi: mahsulot ko'payganda
     ro'yxat konteynerdan oshib ketadi va ichida scroll paydo bo'lmaydi. */
  grid-template-rows: minmax(0, 1fr);

  overflow: hidden;
}

/* Ikkala ustun ham konteyner balandligidan oshmasin */
.order-layout > * { min-height: 0; min-width: 0; height: 100%; }
/* Telefon va planshetda oddiy aylanish qulayroq: butun sahifa aylanadi.
   Shuning uchun hech bir qatlam balandligi cheklanmasligi kerak —
   aks holda barmoq mahsulot ustidan tortilganda harakat ushlanib qoladi. */
@media (max-width: 991px) {
  html.order-html, body.order-page {
    height: auto !important;
    overflow: visible !important;
    overscroll-behavior: auto;
    position: static !important;
  }
  body.order-page .pos-topbar { position: sticky; }

  .order-layout {
    position: static !important; display: block;
    overflow: visible; height: auto !important;
  }
  /* Ustunlarga qo'yilgan qat'iy balandlikni bekor qilamiz */
  .order-layout > *  { height: auto !important; min-height: 0; }

  .order-left { display: block; overflow: visible; height: auto !important; }
  .prod-grid {
    overflow: visible !important;
    height: auto !important;
    overscroll-behavior: auto;
  }
}

/* Barmoq mahsulot ustidan tortilsa ham sahifa aylanaversin.
   Busiz karta bosish deb qabul qilinib, harakat to'xtab qoladi. */
.prod-grid, .prod-card, .cat-bar, .cart-items { touch-action: pan-y; }
.cat-bar { touch-action: pan-x; }

.cat-bar {
  display: flex; gap: 7px; overflow-x: auto; padding: 10px 12px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; flex-wrap: nowrap; align-items: center;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { height: 0; }
.cat-chip {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 20px; background: var(--brand-light);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; border: none;
  white-space: nowrap; line-height: 1.35;
}
.cat-chip.active { background: var(--brand); color: #fff; }

/* Chap ustun: kategoriyalar tepada qotib turadi, mahsulotlar aylanadi.

   Flexbox ishlatilgan va qoidalar bolalar soniga bog'liq emas:
   kategoriyalar paneli o'z balandligini oladi, mahsulotlar qolgan
   hamma joyni egallaydi va ichidan aylanadi. Bolalar soni o'zgarsa
   ham buzilmaydi. */
.order-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.order-left > *          { flex: 0 0 auto; }   /* panellar o'z balandligida */
.order-left > .prod-grid { flex: 1 1 auto; min-height: 0; }   /* qolgan joy mahsulotlarga */

.prod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px; padding: 12px;

  min-height: 0;                    /* scroll shunga bog'liq */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;     /* oxiriga yetganda sahifa tortilmasin */

  /* Qatorlar cho'zilmasin — kartalar o'z balandligida qolsin,
     aks holda tizim hammasini bitta ekranga sig'dirishga urinadi
     va nom bilan narx ko'rinmay ketadi. */
  grid-auto-rows: max-content;
  align-content: start;
  padding-bottom: 24px;
}

/* Sensorli ekranda barmoq bilan aylantirish uchun kengroq chiziq */
.prod-grid::-webkit-scrollbar { width: 10px; }
.prod-grid::-webkit-scrollbar-track { background: transparent; }
.prod-grid::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 10px; border: 2px solid transparent;
  background-clip: content-box;
}
.prod-grid::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }
.prod-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: .14s; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  height: 100%;
  min-height: 168px;      /* nom, narx va qoldiq har doim sig'adi */
}
.prod-card:active { transform: scale(.96); border-color: var(--brand); }

.prod-img {
  height: 100px; flex: 0 0 100px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-size: 24px; overflow: hidden; position: relative;
  padding: 6px;
}
/* Shaffof PNG oq fonda toza ko'rinadi. Tungi rejimda ham fon och qoladi,
   aks holda qora rasmlar ko'rinmay ketadi. */
[data-bs-theme="dark"] .prod-img { background: #F2F1F8; }
/* contain — rasm butunlay ko'rinadi, chetlari kesilmaydi.
   cover ishlatilsa kvadratga sig'dirish uchun qirqilib ketardi. */
.prod-img img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; display: block;
}

.prod-body {
  padding: 7px 9px 9px; flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
}
.prod-name {
  font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.prod-price {
  font-size: 14px; font-weight: 700; color: var(--brand-dark);
  white-space: nowrap; line-height: 1.2;
}
.prod-price .hint { font-size: 10.5px; font-weight: 400; }

/* Rasmi yo'q mahsulotlar uchun ixcham ko'rinish */
.prod-card.noimg { min-height: 92px; }
.prod-card.noimg .prod-img { display: none; }
.prod-card.noimg .prod-body { justify-content: center; min-height: 72px; padding: 10px; }
.prod-card.noimg .prod-name { -webkit-line-clamp: 2; font-size: 13px; }
.prod-card.noimg .prod-name { -webkit-line-clamp: 3; }
.prod-card.stopped { opacity: .55; pointer-events: none; filter: grayscale(.7); }
.stop-tag {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: .5px; padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* ---------- Savat ----------
   Savat ustuni mahsulotlar ro'yxatidan mustaqil.
   Faqat taomlar ro'yxati aylanadi, sarlavha va to'lov qismi joyida qoladi. */
.cart {
  background: #fff; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  height: 100%; min-height: 0; overflow: hidden;
}
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.cart-items {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 12px;
  overscroll-behavior: contain;
}
.cart-foot {
  border-top: 1px solid var(--line); padding: 14px 16px; background: #FBFAFE;
  flex: 0 0 auto;
}

.cart-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid #F3F1FA; }
.cart-item .ci-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.cart-item .ci-note { font-size: 12px; color: var(--warn); margin-top: 2px; }
.cart-item .ci-price{ font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.cart-item .ci-sum  { font-weight: 600; white-space: nowrap; }
.cart-item.sent { background: rgba(125,120,160,.07); border-radius: 8px; }
[data-bs-theme="dark"] .cart-item.sent { background: rgba(255,255,255,.05); }
.cart-item.sent .ci-name { color: var(--ink); }
.cart-item .ci-badge{ font-size: 10.5px; background: var(--ok-bg); color: var(--ok); padding: 1px 6px; border-radius: 8px; }

.qty-box { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 17px; line-height: 1; color: var(--ink-2);
}
.qty-btn:active { background: var(--brand-light); }
.qty-val { min-width: 32px; text-align: center; font-weight: 600; font-size: 14px; }

.total-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); padding: 3px 0; }
.total-row.big { font-size: 21px; font-weight: 700; color: var(--ink); padding-top: 9px; border-top: 1px dashed var(--line); margin-top: 7px; }

/* ---------- To'lov ---------- */
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.pay-btn {
  padding: 20px 12px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  text-align: center; font-weight: 500; transition: .14s;
}
.pay-btn i { font-size: 26px; display: block; margin-bottom: 7px; color: var(--brand); }
.pay-btn.active { border-color: var(--brand); background: var(--brand-light); }
.pay-btn:active { transform: scale(.97); }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.numpad button {
  height: 54px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  font-size: 20px; font-weight: 500;
}
.numpad button:active { background: var(--brand-light); }

/* ---------- Bo'sh holat ---------- */
.empty-state { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty-state i { font-size: 46px; opacity: .35; display: block; margin-bottom: 14px; }

/* ---------- Ofitsiant pastki menyu ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 1040;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 9px 4px 8px; color: var(--ink-3); font-size: 11.5px;
}
.bottom-nav a i { font-size: 21px; display: block; margin-bottom: 2px; }
.bottom-nav a.active { color: var(--brand); }
.has-bottom-nav { padding-bottom: 68px; }

/* ---------- Chop etish ---------- */
@media print { .no-print { display: none !important; } }


/* =====================================================================
   YORDAMCHI TUGMALAR (to'liq ekran, tunggi rejim, AnyDesk, qo'ng'iroq)
   ===================================================================== */
.util-bar {
  display: flex; gap: 2px; align-items: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 11px; padding: 3px;
}
.util-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; color: var(--ink-3); display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px; transition: .13s;
  text-decoration: none;
}
.util-btn:hover  { background: var(--card); color: var(--brand); }
.util-btn:active { transform: scale(.9); }

/* Har bir tugmaning o'z rangi — bosilganda darrov farqlanadi */
.util-btn[data-fs-btn]:hover        { color: var(--info); }
.util-btn.util-theme:hover          { color: var(--warn); }
.util-btn.util-desk:hover           { color: var(--brand); }
.util-btn.util-call:hover           { color: var(--ok); }

/* Faol holat: to'liq ekran yoqilganda tugma yonib turadi */
.util-btn.on { background: var(--brand); color: #fff; }

.util-btn.wide {
  width: auto; padding: 0 14px; gap: 7px; font-size: 14px; font-weight: 500;
  height: 38px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 10px;
}
.util-btn.wide:hover { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand); }

@media (max-width: 575px) {
  .util-bar { gap: 0; padding: 2px; }
  .util-btn { width: 30px; height: 30px; font-size: 15px; }
}

.brand-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  color: var(--ink-3); text-align: center; margin-top: 14px;
}

/* =====================================================================
   EKRAN KLAVIATURASI (monoblok uchun)
   ===================================================================== */
.oskb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  transform: translateY(105%); transition: transform .18s ease;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  user-select: none;
  /* Yopiq turganda bosishlarni ushlab qolmasin — aks holda uning
     ostidagi maydonlarga tegib bo'lmay qoladi */
  visibility: hidden; pointer-events: none;
}
.oskb.on { transform: translateY(0); visibility: visible; pointer-events: auto; }

.oskb-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 8px; font-size: 13px; color: var(--ink-3);
}
.oskb-close {
  border: none; background: var(--line); color: var(--ink-2);
  border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 500;
}

.oskb-row { display: flex; gap: 6px; margin-bottom: 6px; justify-content: center; }

.oskb-key {
  flex: 1 1 0; min-width: 0; height: 52px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--ink);
  font-size: 19px; font-weight: 500; transition: .08s;
}
.oskb-key:active { background: var(--brand); color: #fff; transform: scale(.94); }
.oskb-key.fn { background: var(--line); font-size: 16px; flex: 0 0 78px; }
.oskb-key.fn.on { background: var(--brand); color: #fff; }
.oskb-key.fn.ok { background: var(--ok); color: #fff; }
.oskb-key.wide-space { flex: 3 1 0; font-size: 14px; color: var(--ink-3); }

/* Klaviatura ochiqda sahifa pastidan joy qoldiramiz */
body.oskb-open { padding-bottom: 300px; }
body.oskb-open .modal { padding-bottom: 300px; }

@media (max-width: 600px) {
  .oskb-key { height: 46px; font-size: 17px; }
  .oskb-key.fn { flex: 0 0 58px; }
  body.oskb-open { padding-bottom: 260px; }
}

/* =====================================================================
   OFITSIANT — TELEFON VA PLANSHET UCHUN IXCHAM KO'RINISH
   Android WebView ilovasida ishlatiladi.
   ===================================================================== */
.waiter-mode .pos-topbar { height: 52px; padding: 0 10px; }
.waiter-mode .pos-topbar .fw-semibold { font-size: 15px; }

/* Stollar: kichikroq, ko'proq sig'adi */
.waiter-mode .tables-grid {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; padding: 10px;
}
.waiter-mode .table-card {
  min-height: 84px; padding: 9px 6px; border-radius: 11px; border-width: 2px;
}
.waiter-mode .table-card .t-name  { font-size: 19px; }
.waiter-mode .table-card .t-seats { font-size: 10.5px; margin-top: 1px; }
.waiter-mode .table-card .t-sum   { font-size: 13px; margin-top: 4px; }
.waiter-mode .table-card .t-meta  { font-size: 10px; margin-top: 1px; }
.waiter-mode .table-card .t-timer { font-size: 10px; padding: 1px 5px; top: 5px; right: 5px; }

/* Zal sarlavhasi ixchamroq */
.waiter-mode .zone-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-3); padding: 12px 12px 4px;
}

/* Buyurtma ekrani: telefonda savat pastdan chiqadigan varaq bo'ladi */
@media (max-width: 991px) {
  .waiter-mode .order-layout { display: block; height: auto; }

  .waiter-mode .prod-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 8px; padding: 10px; padding-bottom: 90px;
  }
  .waiter-mode .prod-img   { height: 92px; flex: 0 0 92px; font-size: 21px; padding: 5px; }
  .waiter-mode .prod-body  { padding: 6px 8px 8px; }
  .waiter-mode .prod-name  { font-size: 12px; line-height: 1.25; }
  .waiter-mode .prod-price { font-size: 13px; margin-top: 3px; }

  .waiter-mode .cat-bar { padding: 8px 10px; gap: 6px; }
  .waiter-mode .cat-chip { padding: 7px 14px; font-size: 13px; }

  /* Savat — pastdan ko'tariladigan varaq */
  .waiter-mode .cart {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
    height: auto; max-height: 82vh; border-left: none;
    border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 28px rgba(0,0,0,.16);
    transform: translateY(calc(100% - 62px)); transition: transform .22s ease;
  }
  .waiter-mode .cart.open { transform: translateY(0); }
  .waiter-mode .cart-items { max-height: 42vh; }

  /* Varaqni ochadigan tutqich */
  .cart-handle {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line);
  }
  .cart-handle .ch-count {
    background: var(--brand); color: #fff; border-radius: 20px;
    padding: 3px 11px; font-size: 13px; font-weight: 600; min-width: 30px; text-align: center;
  }
  .cart-handle .ch-sum { margin-left: auto; font-size: 17px; font-weight: 700; }
  .cart-handle .ch-arrow { color: var(--ink-3); transition: transform .2s; }
  .waiter-mode .cart.open .ch-arrow { transform: rotate(180deg); }
}

@media (min-width: 992px) {
  .cart-handle { display: none; }
}

/* Pastki menyu ixchamroq */
.waiter-mode .bottom-nav a { padding: 7px 4px 6px; font-size: 10.5px; }
.waiter-mode .bottom-nav a i { font-size: 19px; }
.waiter-mode .has-bottom-nav { padding-bottom: 60px; }

/* =====================================================================
   SAHIFA ICHIDAGI OYNALAR (alert / confirm o'rniga)
   ===================================================================== */
.uid-wrap {
  position: fixed; inset: 0; z-index: 3000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.uid-wrap.on { display: flex; }
.uid-back { position: absolute; inset: 0; background: rgba(20,18,30,.5); backdrop-filter: blur(2px); }

.uid-card {
  position: relative; background: var(--card); color: var(--ink);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 28px 26px 22px; width: 100%; max-width: 400px; text-align: center;
  animation: uidIn .16s ease;
}
@keyframes uidIn { from { transform: scale(.94); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.uid-icon {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.uid-card.danger .uid-icon { background: var(--danger-bg); color: var(--danger); }

.uid-msg { font-size: 15.5px; line-height: 1.5; white-space: pre-line; margin-bottom: 18px; }
.uid-input { margin-bottom: 16px; text-align: center; font-size: 17px; }
.uid-btns { display: flex; gap: 9px; }
.uid-btns .btn { flex: 1; padding: 11px; font-size: 15px; border-radius: 11px; }


/* Katta monoblok ekranida rasmlar kattaroq ko'rinadi */
@media (min-width: 1400px) {
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
  .prod-img  { height: 120px; flex: 0 0 120px; }
}

/* =====================================================================
   CLICK TO'LOVI
   ===================================================================== */
.qr-box {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; display: inline-block; min-width: 220px; min-height: 220px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.qr-box svg { width: 200px; height: 200px; display: block; }

.click-state {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-top: 14px; padding: 10px 14px; border-radius: 11px;
  font-size: 14.5px; font-weight: 500;
}
.click-state.waiting { background: var(--warn-bg); color: #A9670C; }
.click-state.ok      { background: var(--ok-bg);   color: var(--ok); }
.click-state.fail    { background: var(--danger-bg); color: var(--danger); }
[data-bs-theme="dark"] .click-state.waiting { color: var(--warn); }


/* Til tanlash */
.util-lang-wrap { display: inline-block; }
.util-btn.util-lang {
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 3px;
  width: auto; padding: 0 9px;
}
.util-btn.util-lang i { font-size: 9px; opacity: .6; }
.util-lang-wrap .dropdown-menu { min-width: 150px; }
.util-lang-wrap .dropdown-item.active { background: var(--brand-light); color: var(--brand-dark); }


/* =====================================================================
   ARALASH TO'LOV
   ===================================================================== */
.split-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 9px;
}
.split-row label {
  flex: 0 0 118px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px; margin: 0;
}
.split-row .split-in {
  flex: 1; text-align: right; font-size: 18px; font-weight: 600; padding: 10px 12px;
}
.split-sum {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 14px; border-radius: 11px; margin-top: 12px; font-size: 14.5px;
}
.split-sum.need { background: var(--warn-bg); color: #A9670C; }
.split-sum.over { background: var(--danger-bg); color: var(--danger); }
.split-sum.ok   { background: var(--ok-bg); color: var(--ok); }
[data-bs-theme="dark"] .split-sum.need { color: var(--warn); }


/* =====================================================================
   XODIMLAR UCHUN NARX
   ===================================================================== */
.staff-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--warn-bg); border-bottom: 1px solid var(--line);
}
.staff-toggle {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-size: 14px; font-weight: 600; color: #A9670C; cursor: pointer;
}
.staff-toggle input { width: 18px; height: 18px; }
[data-bs-theme="dark"] .staff-toggle { color: var(--warn); }

/* Xodim rejimida chegirmali narx ko'rsatiladi */
body.staff-on .prod-price .p-normal { display: none; }
body.staff-on .prod-price .p-staff  { display: inline !important; color: var(--warn); }
body.staff-on .cart-head { background: var(--warn-bg); }


/* =====================================================================
   MAHSULOT QO'SHISH OYNASI
   Maydonlar ko'p bo'lgani uchun keng oyna va uch ustunli joylashuv.
   ===================================================================== */
.crud-modal { max-width: 1080px; }
.crud-modal .modal-body { max-height: 76vh; overflow-y: auto; }
.crud-modal .form-label { margin-bottom: 3px; }
.crud-modal .hint { font-size: 12px; line-height: 1.35; margin-top: 2px; }
.crud-modal .row > [class*="col-"] { margin-bottom: 2px; }

/* Katta ekranda yarim kenglikdagi maydonlar uchdan biriga tushadi —
   oyna qisqaradi, pastga cho'zilib ketmaydi */
@media (min-width: 1200px) {
  .crud-modal .row > .col-md-6 { flex: 0 0 33.3333%; max-width: 33.3333%; }
}
@media (max-width: 767px) {
  .crud-modal { max-width: 100%; margin: 8px; }
  .crud-modal .modal-body { max-height: 80vh; }
}

/* Chegirma paneli */
.disc-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.disc-head {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; background: var(--bg); border: none;
  font-size: 14.5px; font-weight: 500; color: var(--ink);
}
.disc-head:active { background: var(--brand-light); }
.disc-body { padding: 14px; border-top: 1px solid var(--line); }

/* Smena: kassadan chiqqan pullar ro'yxati */
.cm-list { padding: 2px 0 6px 12px; border-left: 2px solid var(--line); margin: 2px 0 6px 4px; }
.cm-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 2px 0; }

.shift-period {
  background: var(--bg); border-radius: 10px; padding: 9px 12px;
  margin-bottom: 10px; font-size: 13px; color: var(--ink-2);
}

.shift-period.warn {
  background: var(--warn-bg); color: #8A5A0B;
  border-left: 3px solid var(--warn);
}
[data-bs-theme="dark"] .shift-period.warn { color: var(--warn); }

.nav-x.nav-warn { background: var(--warn-bg); color: #8A5A0B; font-weight: 600; }
[data-bs-theme="dark"] .nav-x.nav-warn { color: var(--warn); }

/* =====================================================================
   RASMNI KATTALASHTIRISH
   ===================================================================== */
.prod-img { cursor: zoom-in; }
.zoom-hint {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(0,0,0,.45); color: #fff; border-radius: 6px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; opacity: .8; pointer-events: none;
}

.img-zoom {
  position: fixed; inset: 0; z-index: 3500;
  background: rgba(10,8,18,.92);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.img-zoom.on { display: flex; }
.iz-inner { position: relative; max-width: 92vw; max-height: 88vh; text-align: center; }
.iz-inner img {
  max-width: 92vw; max-height: 76vh; border-radius: 14px;
  background: #fff; display: block; margin: 0 auto;
}
.iz-name { color: #fff; font-size: 17px; font-weight: 600; margin-top: 14px; }
.iz-close {
  position: absolute; top: -14px; right: -8px;
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* BirZum24 xabari */
.bz-toast {
  position: fixed; top: 70px; right: 16px; z-index: 3200;
  background: var(--ok); color: #fff; padding: 13px 20px;
  border-radius: 12px; font-size: 15px; font-weight: 500;
  box-shadow: 0 6px 22px rgba(0,0,0,.22);
  animation: bzIn .25s ease;
}
@keyframes bzIn { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }

/* Sozlamalar bo'limlari */
.set-nav {
  display:flex; gap:7px; overflow-x:auto; padding:4px 2px 12px; margin-bottom:6px;
  scrollbar-width:none;
}
.set-nav::-webkit-scrollbar { display:none; }
.set-tab {
  flex:0 0 auto; background:var(--card); border:1px solid var(--line);
  color:var(--ink-2); border-radius:11px; padding:9px 15px;
  font-size:13.5px; font-weight:600; white-space:nowrap;
}
.set-tab.on { background:var(--brand); border-color:var(--brand); color:#fff; }

/* Menyudagi ochiladigan bo'lim */
.nav-drop {
  width:100%; background:none; border:none; text-align:left;
  display:flex; align-items:center; gap:11px;
}
.nav-drop .drop-arrow { margin-left:auto; font-size:11px; transition:transform .2s; }
.nav-drop.open .drop-arrow { transform:rotate(180deg); }
.nav-sub { display:none; padding:2px 0 6px 0; }
.nav-sub.open { display:block; }
.nav-sub-item {
  display:flex; align-items:center; gap:9px;
  padding:8px 14px 8px 40px; font-size:13.5px; color:var(--ink-2);
  text-decoration:none; border-left:2px solid transparent;
}
.nav-sub-item i { font-size:14px; opacity:.7; }
.nav-sub-item:hover { background:var(--bg); color:var(--ink); }
.nav-sub-item.active {
  color:var(--brand); border-left-color:var(--brand);
  background:var(--brand-light); font-weight:600;
}
