/* iPOS desktop package (js/appdesk.js + js/popwin.js): side bar, windows, price check, Dash Board. Colours = the app's own --brand. */
:root { --ad-1: var(--brand-2, #0b4a72); --ad-2: var(--brand, #0f5c8c); --ad-soft: var(--brand-soft, #e6f0f7); --ad-dark: var(--nav-bg, #0e2233); }
#dsb { position: fixed; left: 0; top: 0; bottom: 0; width: 108px; z-index: 30; display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 8px; background: linear-gradient(180deg, var(--ad-soft), color-mix(in srgb, var(--ad-soft) 80%, #c9d3dc)); border-right: 1px solid color-mix(in srgb, var(--ad-2) 25%, #d8dee4); overflow: hidden; }
#dsb[hidden] { display: none; }
body.dsb-on .app { padding-left: 108px; box-sizing: border-box; }
body.dsb-on .app > #view, body.dsb-on .app > main { min-width: 0; max-width: 100%; }
body.dsb-on #appFoot { left: 108px; }
body.dsb-on .sidenav { display: none !important; }
.dsb-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 40px; flex: 0 1 60px; padding: 4px; border-radius: 10px; color: var(--ad-dark); text-decoration: none; font-size: 12px; font-weight: 700; text-align: center; line-height: 1.15; background: #fff; border: 1px solid color-mix(in srgb, var(--ad-2) 22%, #dde3e8); cursor: pointer; }
.dsb-b svg { width: 22px; height: 22px; flex: none; color: var(--ad-2); }
.dsb-b:hover { background: var(--ad-soft); border-color: var(--ad-2); }
.dsb-b.on { background: var(--ad-2); color: #fff; border-color: var(--ad-2); } .dsb-b.on svg { color: #fff; }
.dsb-b.dsb-dash { background: #f5a524; border-color: #e0901a; color: #1c1300; } .dsb-b.dsb-dash svg { color: #1c1300; }
.dsb-b.dsb-price { background: var(--ad-dark); color: #fff; border-color: var(--ad-dark); } .dsb-b.dsb-price svg { color: #f5c46b; }
.dsb-b.dsb-exit { color: #b91c1c; } .dsb-b.dsb-exit svg { color: #b91c1c; }
.dsb-sp { flex: 1 1 auto; min-height: 4px; }
@media print { #dsb { display: none !important; } body.dsb-on .app { padding-left: 0 !important; } }
/* small windows */
.dw-bg { position: fixed; inset: 0; z-index: 8500; background: rgba(10, 16, 24, .42); display: flex; align-items: center; justify-content: center; padding: 18px; }
.dw { background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; max-height: 100%; width: min(720px, 100%); color: #14222f; }
.dw-h { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--ad-dark); color: #fff; flex: none; }
.dw-h b { font-size: 17px; } .dw-h .small { color: rgba(255,255,255,.75); }
.dw-x { margin-left: auto; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 34px; height: 34px; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; }
.dw-x:hover { background: #b91c1c; }
.pc-hint { color: #64748b; text-align: center; padding: 30px 16px; }
.dw.pc { width: min(760px, 100%); }
.pc-in { padding: 14px 16px 6px; } .pc-in input { width: 100%; min-height: 56px; font-size: 22px; font-weight: 700; box-sizing: border-box; }
.pc-res { padding: 8px 18px 18px; min-height: 260px; }
.pc-name { font-size: 26px; font-weight: 800; color: var(--ad-dark); }
.pc-sub { color: #64748b; margin: 2px 0 8px; }
.pc-big { font-size: 54px; font-weight: 900; color: var(--ad-2); line-height: 1.1; margin: 4px 0 12px; }
.pc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pc-grid > div { background: var(--ad-soft); border: 1px solid color-mix(in srgb, var(--ad-2) 18%, #e2e8f0); border-radius: 10px; padding: 8px 10px; } .pc-grid small { display: block; color: #64748b; font-size: 12px; } .pc-grid b { font-size: 17px; }
.pc-grid > div.neg b { color: #b91c1c; }
.pc-list { display: flex; flex-direction: column; gap: 6px; } .pc-list button { display: flex; justify-content: space-between; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; font: inherit; cursor: pointer; } .pc-list button:hover { border-color: var(--ad-2); background: var(--ad-soft); }
/* page windows (popwin.js) in the app's colours */
.pw-head { background: var(--ad-dark) !important; }
.pw-head .pw-a .btn { color: var(--ad-dark) !important; }
.pw-bg.ad-dash { padding: 10px; } .pw-bg.ad-dash .pw { max-width: none; }
.db-auto { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #fde68a; cursor: pointer; }
/* iPOS pop-up pages on the PC (js/popwin.js) */
.pw-bg { position: fixed; inset: 0; z-index: 8000; background: rgba(10, 20, 14, .45); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; }
.pw { width: 100%; height: 100%; max-width: 1500px; background: var(--bg, #f3f5f2); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.pw-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #14391f; color: #fff; flex: none; flex-wrap: wrap; }
.pw-head .pw-t { margin: 0; font-size: 19px; color: #fff; flex: 1 1 auto; min-width: 160px; }
.pw-head .pw-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pw-head .pw-a .btn { background: #fff; color: #14391f; } .pw-head .pw-a .btn.primary, .pw-head .pw-a .btn.wa { background: #22c55e; color: #fff; border-color: #22c55e; } .pw-head .pw-a .btn.bad, .pw-head .pw-a .btn.danger { color: #b91c1c; }
.pw-head .pw-a #installBtn, .pw-head .pw-a .install-btn { display: none !important; }
.pw-x { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 24px; line-height: 1; cursor: pointer; flex: none; }
.pw-x:hover { background: #b91c1c; }
.pw-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px; }
.pw-body > .card:first-child { margin-top: 0; }
.pw-foot { display: flex; justify-content: flex-end; padding: 12px 0 2px; }
.pw-exit { min-width: 120px; color: #b91c1c; font-weight: 700; }
body.pw-noinst #installBtn, body.pw-noinst .install-btn { display: none !important; }
@media print { .pw-bg { position: static; background: none; padding: 0; } .pw { box-shadow: none; height: auto; } .pw-head, .pw-foot { display: none; } }
/* desktop login window (desk-chrome): never a scroll bar in the small window */
html:has(body.dc-login), body.dc-login { overflow: hidden; }
/* back office fits the window (PansarPOS): the menu, side bar and footer stay put; only the page area scrolls inside */
body.dsb-on { height: 100vh; overflow: hidden; }
body.dsb-on .app { height: calc(100vh - var(--ad-top, 96px)); min-height: 0 !important; overflow: hidden; }
body.dsb-on .app > .main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
body.dsb-on .app > .main > *:not(#view) { flex: none; }
body.dsb-on #view { flex: 1 1 auto; min-height: 0; overflow: auto; padding-bottom: calc(var(--ad-foot, 24px) + 12px); }
@media print { body.dsb-on, body.dsb-on .app, body.dsb-on .app > .main, body.dsb-on #view { height: auto !important; overflow: visible !important; } }
/* (19 Nov) in the desktop program the top bar is the title bar (Windows' − □ × sit on it): windows and dialogs start under it */
body.dc-fl .pw-bg, body.dc-fl .dw-bg, body.dc-fl .modal-bg { top: var(--ad-hdr, 40px) !important; }
body.dc-fl .pw-bg { padding-top: 10px; padding-bottom: 10px; }
/* no Home / Dashboard links in the back-office menu (Esc or the shop name goes Home; the side bar has Dash Board) */
html.ad-nohome #topnav > a[data-k="home"], html.ad-nohome #topnav > a[data-k="dashboard"] { display: none !important; }
html.ad-nohome body.nav-top .shopbar-logo, html.ad-nohome body.nav-top .shopbar-t { cursor: pointer; }
/* the page title bar sits at the top of the page area (it was sticky under the old page scroll and left a gap) */
body.dsb-on .app > .main > .topbar { position: relative !important; top: 0 !important; }
/* Settings window: the cards flow in columns down the window (never sideways); the window scrolls, its title bar stays */
.pw:has(> .pw-body.settings-compact) { display: block; overflow-y: auto; overflow-x: hidden; }
.pw:has(> .pw-body.settings-compact) > .pw-head { position: sticky; top: 0; z-index: 3; }
.pw > .pw-body.settings-compact { overflow: visible; height: auto; min-height: 0; }
/* Dash Board window fits: the figures stay, the last lists fill the rest and scroll inside their own boxes */
.pw-bg.ad-dash .pw-body { display: flex; flex-direction: column; overflow: hidden; }
.pw-bg.ad-dash .pw-body > * { flex: none; }
.pw-bg.ad-dash .pw-body > .pw-foot { display: none; }
.pw-bg.ad-dash .pw-body > .ad-grow { flex: 1 1 auto; min-height: 0; margin-bottom: 0; }
.pw-bg.ad-dash .ad-grow.grid { grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.pw-bg.ad-dash .ad-grow > .card, .pw-bg.ad-dash .card.ad-grow { display: flex; flex-direction: column; min-height: 0; overflow: hidden; margin-bottom: 0; }
.pw-bg.ad-dash .ad-grow .tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.pw-bg.ad-dash .ad-grow .tablewrap th { position: sticky; top: 0; background: #fff; z-index: 1; }
.pw-bg.ad-dash .pw-body.ad-dc > .card, .pw-bg.ad-dash .pw-body.ad-dc > .grid { margin-bottom: 8px; }
.pw-bg.ad-dash .pw-body.ad-dc .card { padding-top: 10px; padding-bottom: 10px; }
/* short laptop screens: the side bar buttons get smaller instead of scrolling */
@media (max-height: 760px) { .dsb-b { gap: 1px; padding: 2px 4px; font-size: 11.5px; } .dsb-b svg { width: 19px; height: 19px; } #dsb { gap: 3px; padding-top: 4px; padding-bottom: 4px; } }
/* (19 Nov) Home on the PC: no "More software / Our services" sliders and no version line (Ali) */
body.dsb-on .hk-promos, body.dsb-on .hk-foot { display: none !important; }
/* ---------- list pages as fixed windows (cfg.lists, 19 Nov): only the long lists scroll, headings stay ---------- */
.pw-bg.ad-list .pw-body { overflow: hidden; padding-bottom: 10px; }
.pw-bg.ad-list .pw-body > .pw-foot { display: none; }
.pw-bg.ad-list .ad-scroll { overflow: auto !important; }
.pw-bg.ad-list .ad-scroll thead th, .pw-bg.ad-list .ad-scroll table > tbody:first-child > tr:first-child > th, .pw-bg.ad-list .ad-scroll table > tr:first-child > th { position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
.pw-bg.ad-list .pw-body.ad-dc .card { padding-top: 10px; padding-bottom: 10px; }
.pw-bg.ad-list .pw-body.ad-dc > .card, .pw-bg.ad-list .pw-body.ad-dc > .grid { margin-bottom: 8px; }
.pw-bg.ad-list .pw-body.ad-col { display: flex; flex-direction: column; }
.pw-bg.ad-list .pw-body.ad-col > * { flex: none; }
.pw-bg.ad-list .pw-body.ad-col > .ad-rest { flex: 1 1 auto; min-height: 0; overflow: auto; padding-right: 2px; }
.pw-bg.ad-list .pw-body.ad-free { overflow: auto; }

/* the top menu drop-downs open OVER the side bar (Ali 19 Nov: Initial System menu was hidden behind it) */
body.nav-top:not(.ms-on) #topnav.topnav { z-index: 40; }
