/* iPOS counter kit - fixed counter-bill layout on the PC (js/counter-kit.js moves the page's own parts into it) */
body.bk-mode .app, body.bk-mode .main { min-height: 0 !important; }
body.bk-mode .content { padding: 8px 14px 6px !important; max-width: none !important; }
body.bk-mode .topbar { padding-top: 6px !important; padding-bottom: 6px !important; min-height: 0 !important; }
body.bk-mode .topbar h1 { font-size: 20px; }
body.bk-mode .topbar .btn { min-height: 34px; padding-top: 5px; padding-bottom: 5px; }
.bk-split { display: block !important; }
#sForm.bk { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; min-height: 0; }
#sForm.bk [hidden] { display: none !important; }
#sForm.bk .card { margin: 0; padding: 10px 12px; }
.bk-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.bk-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; background: var(--brand-soft, #eef4f8);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff); border-radius: 12px; padding: 10px 12px 0; }

/* 1 - header line */
.bk-head { flex: none; }
.bk-hbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: nowrap; }
.bk-hbar > label.f, .bk-hbar > .f { margin: 0 !important; flex: 0 0 auto; min-width: 0; grid-column: auto !important; }
.bk-hbar > label.f:first-child { flex: 1 1 auto; }
.bk-hbar > label.f:first-child input { width: 100%; }
.bk-hbar input[type=date] { width: 150px; }
.bk-hbar select { min-width: 140px; max-width: 200px; }
.bk-hbar label.f > span { font-size: 12px; margin-bottom: 3px; }
.bk-hbar input, .bk-hbar select { height: 38px; min-height: 38px; }
.bk-open { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 38px; height: 38px;
  padding: 2px 12px; line-height: 1.15; font-weight: 600; white-space: nowrap; max-width: 230px; position: relative; }
.bk-open small { font-size: 11px; font-weight: 500; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.bk-open small:empty { display: none; }
.bk-open.need { border-color: #d97706 !important; box-shadow: 0 0 0 2px #fde68a; }
.bk-open.need::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #d97706; }
.bk-notes { max-height: 64px; overflow: auto; }
.bk-notes:empty, .bk-notes > div:empty { display: none; }
.bk-notes .banner { margin: 8px 0 0 !important; padding: 6px 10px; font-size: 13px; }

/* 2 - items: search + category chips on one line, tiles (2 rows, scroll inside), lines (scroll inside) */
.bk-items { flex: 1; min-height: 0; display: grid !important; grid-template-columns: auto minmax(160px, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
  column-gap: 10px; overflow: hidden; align-content: stretch; }
.bk-items > .bk-h2 { display: none; }
.bk-items > *, .bk-items #sPick > * { grid-column: 1 / -1; min-width: 0; }
#sForm.bk #sPick, #sForm.bk #sPick > .pk { display: contents; }
.bk-items > .pos-find, .bk-items > .pos-bar { grid-column: 1; grid-row: 1; margin: 0 0 6px !important; display: flex; gap: 6px; align-items: center; }
.bk-items :is(.pos-find, .pos-bar) .ac-wrap { flex: 1 0 280px; min-width: 0; }
.bk-items :is(.pos-find, .pos-bar) input, .bk-items :is(.pos-find, .pos-bar) .btn { height: 38px; min-height: 38px; }
.bk-items .bk-add, .bk-items .bk-tiles { flex: none; padding: 4px 10px; white-space: nowrap; }
.bk-items .bk-tiles.on { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, #fff); background: color-mix(in srgb, var(--brand) 8%, #fff); }
.bk-items > .seg { grid-column: 2 !important; grid-row: 1; margin: 0 0 6px !important; align-self: center; display: flex; flex-wrap: nowrap; overflow-x: auto; }
.bk-items .pk-cats { grid-column: 2 !important; grid-row: 1; margin: 0 0 6px !important; align-self: center; }
.bk-items .pk-cats button { min-height: 32px; padding: 4px 12px; }
.bk-items .prodgrid { grid-row: 2; margin: 0 !important; max-height: 132px !important; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important; grid-auto-rows: max-content !important; align-content: start; gap: 6px !important; padding: 2px; }
.bk-items .prodgrid .prod { min-height: 0 !important; padding: 6px 9px !important; gap: 1px !important; border-radius: 10px; }
.bk-items .prodgrid .prod b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.bk-items .prodgrid .prod .s { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-items .prodgrid .prod .p { font-size: 13px; }
.bk-items .prodgrid .prod .tb { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.bk-items .prodgrid.big .prod { flex-direction: column; align-items: flex-start; text-align: left; }
.bk-items .pk-n { top: 4px !important; right: 4px !important; font-size: 11px; padding: 0 6px; }
body.bk-notiles .bk-items .prodgrid { display: none !important; }
.bk-items .bk-lines { grid-row: 3; min-height: 90px; overflow: auto; margin-top: 6px; border-top: 1px solid var(--line, #e2e7ef); }
.bk-items .bk-lines table { margin: 0; }
.bk-items .bk-lines th { position: sticky; top: 0; z-index: 1; background: var(--card, #fff); box-shadow: 0 1px 0 var(--line, #e2e7ef); }
.bk-lfoot { grid-row: 4; display: flex; gap: 8px; padding-top: 6px; }
.bk-lfoot .btn { min-height: 30px; padding: 3px 10px; }

/* 3 - right: bill, payment, buttons */
#sForm.bk .bk-side > .card { background: transparent; box-shadow: none; padding: 0; border: 0; }
.bk-calc h2 { margin: 0 0 4px; font-size: 16px; }
.bk-calc .kv { row-gap: 2px; }
.bk-calc .big { font-size: 26px; }
.bk-calc p { margin: 4px 0 0 !important; }
.bk-pv { display: flex; flex-direction: column; gap: 6px; }
.bk-pv > label.f { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; }
.bk-pv > label.f > span { flex: 1; margin: 0 !important; }
.bk-pv > label.f > input, .bk-pv > label.f > select { width: 150px; height: 34px; min-height: 34px; padding-top: 0; padding-bottom: 0; }
.bk-pv > label.f > input { text-align: right; }
.bk-pv > .f:not(label) { margin: 0; }
.bk-pv > .f:not(label) > span { display: none; }
.bk-pv .row { gap: 6px; flex-wrap: nowrap; }
.bk-pv .row .btn { flex: 1; min-height: 32px; padding: 4px 6px; font-size: 13px; }
.bk-pv .bk-open { width: 100%; max-width: none; height: auto; min-height: 36px; }
.bk-acts { position: sticky; bottom: 0; margin-top: auto !important; padding: 8px 0 10px; background: var(--brand-soft, #eef4f8);
  display: flex; gap: 8px; box-shadow: 0 -6px 10px -8px rgba(0, 0, 0, .25); }
.bk-acts .btn { flex: 1; min-height: 42px; }
.bk-acts .btn.primary { flex: 2; font-size: 15px; }

/* popups (they stay inside the form, so the page reads their fields as before) */
.bk-pop { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.bk-pbox { background: var(--card, #fff); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.bk-phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line, #e2e7ef); position: sticky; top: 0; background: inherit; z-index: 1; }
.bk-phead b { font-size: 16px; }
.bk-pbody { padding: 14px 16px 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; align-items: end; }
.bk-pbody > label.f { grid-column: auto !important; }
.bk-pbody > .f:not(label), .bk-pbody > div:not(.f), .bk-pbody > .grid, .bk-pbody > .card, .bk-pbody > .banner { grid-column: 1 / -1; }
.bk-pbody > .card { box-shadow: none; border: 1px solid var(--line, #e2e7ef); }
.bk-lines td:first-child { width: 40%; }
.bk-lines td:first-child input { width: 100% !important; min-width: 180px; }
.bk-lines select.w-s { min-width: 90px; }
body.bk-mode #demoPill { bottom: 1px !important; right: auto !important; left: 50% !important; transform: translateX(-50%); padding: 2px 10px !important; font-size: 11px !important; }
.bk-lines td, .bk-lines th { padding-top: 3px !important; padding-bottom: 3px !important; }
.bk-lines td input, .bk-lines td select { height: 32px; min-height: 32px; padding-top: 0; padding-bottom: 0; }
.bk-lines td .small { font-size: 11.5px; line-height: 1.25; }
.bk-lines td:first-child { width: 34%; }
.bk-lines select.w-s { min-width: 96px !important; }
.bk-notes .banner { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-notes .banner:hover { -webkit-line-clamp: unset; }
.bk-pbody > .chg { grid-column: 1 / -1; }
.bk-pbody > .ref-box { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
body.billing-full .app { min-height: 0 !important; padding-bottom: 0 !important; }
.bk-lines td:first-child select { width: 100%; min-width: 150px; }
