/* CMS-POS — blue sidebar + white cards, after the CMS GLOBAL identity */
:root{
  --blue:#1769E0; --blue-2:#1259D6; --blue-3:#0B3E9E; --blue-pill:#2F7BF2; --blue-soft:#E8F0FD;
  --bg:#F1F5FC; --card:#FFFFFF; --ink:#13213C; --muted:#62708A; --line:#E3E9F3;
  --green:#14A06B; --orange:#F59E0B; --purple:#6D4AE0; --red:#E03A3A;
  --green-soft:#E3F6EE; --orange-soft:#FEF3DC; --red-soft:#FDE7E7; --purple-soft:#EEEAFD;
  --r:14px; --shadow:0 1px 2px rgba(19,33,60,.05),0 6px 18px rgba(19,33,60,.06);
  --font:"Segoe UI",Roboto,"Helvetica Neue",Arial,system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body,#app{height:100%}
.appwrap{display:flex;flex-direction:column;height:100%}
.appwrap>.shell{flex:1;min-height:0}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.45 var(--font);-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased}
button{font:inherit;cursor:pointer;border:0;background:none;color:inherit}
input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid #8DB6F7;outline-offset:2px}
.boot{height:100%;display:grid;place-items:center}
.num{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
[hidden]{display:none!important}

/* ---------- buttons & fields ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border-radius:10px;font-weight:600;background:var(--blue-soft);color:var(--blue-2);transition:filter .15s,transform .05s}
.btn:active{transform:scale(.98)}
.btn.primary{background:var(--blue);color:#fff}
.btn.primary:hover{filter:brightness(1.06)}
.btn.ghost{background:transparent;color:var(--muted);border:1px solid var(--line)}
.btn.danger{background:var(--red-soft);color:var(--red)}
.btn.green{background:var(--green);color:#fff}
.btn.lg{min-height:56px;font-size:17px;border-radius:12px}
.btn.sm{min-height:34px;padding:0 12px;font-size:13px;border-radius:8px}
.btn[disabled]{opacity:.5;pointer-events:none}
.btn svg{width:18px;height:18px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:13px;font-weight:600;color:var(--muted)}
.input{width:100%;min-height:46px;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:#fff}
.input:focus{border-color:var(--blue);outline:none;box-shadow:0 0 0 3px rgba(23,105,224,.15)}
.form{display:grid;gap:14px}
.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:520px){.form .row2{grid-template-columns:1fr}}
.check{display:flex;align-items:center;gap:10px;font-weight:500}
.check input{width:20px;height:20px;accent-color:var(--blue)}
.err{color:var(--red);font-size:14px;min-height:20px}

/* ---------- public pages (landing / auth) ---------- */
.pub{min-height:100%;display:grid;grid-template-columns:1.05fr 1fr}
.pub-side{background:linear-gradient(160deg,var(--blue-2),var(--blue-3));color:#fff;padding:48px clamp(24px,5vw,64px);display:flex;flex-direction:column;gap:28px;justify-content:center}
.pub-side img{width:170px}
.pub-side h1{font-size:clamp(28px,3.4vw,42px);line-height:1.12;margin:0;text-wrap:balance;font-weight:700}
.pub-side p{margin:0;color:#D5E3FB;max-width:46ch;font-size:17px}
.feat{display:grid;grid-template-columns:1fr 1fr;gap:14px;max-width:520px}
.feat div{display:flex;gap:10px;align-items:flex-start;font-size:14px;color:#E6EEFC}
.feat svg{flex:none;width:22px;height:22px;color:#9CC2FA}
.pub-main{display:grid;place-items:center;padding:32px 16px}
.auth{width:100%;max-width:420px;display:grid;gap:18px}
.auth h2{margin:0;font-size:26px}
.auth .alt{text-align:center;color:var(--muted);font-size:14px}
.auth .alt button{color:var(--blue);font-weight:600}
.demo-card{border:1px dashed #A9C6F5;background:var(--blue-soft);border-radius:var(--r);padding:16px;display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.demo-card b{display:block}
.by{font-size:12px;color:var(--muted);text-align:center}
@media(max-width:860px){.pub{grid-template-columns:1fr}.pub-side{padding:32px 20px}.feat{grid-template-columns:1fr}}

/* ---------- lock screen ---------- */
.lock{min-height:100%;background:linear-gradient(160deg,var(--blue-2),var(--blue-3));display:grid;place-items:center;padding:24px 16px}
.lock-card{background:#fff;border-radius:20px;box-shadow:0 20px 50px rgba(5,25,70,.35);width:100%;max-width:460px;padding:28px;display:grid;gap:20px;text-align:center}
.lock-card .shop{display:grid;gap:4px;justify-items:center}
.lock-card .shop img{max-height:64px;max-width:200px}
.lock-card h2{margin:0;font-size:22px}
.users{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px}
.utile{display:grid;justify-items:center;gap:8px;padding:14px 8px;border-radius:12px;border:1px solid var(--line);font-weight:600;font-size:14px}
.utile:hover{border-color:var(--blue);background:var(--blue-soft)}
.avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:18px;flex:none}
.avatar.sm{width:36px;height:36px;font-size:14px}
.role{font-size:12px;color:var(--muted);font-weight:500}
.dots{display:flex;gap:12px;justify-content:center;min-height:18px}
.dots i{width:16px;height:16px;border-radius:50%;border:2px solid #B7C7E3}
.dots i.on{background:var(--blue);border-color:var(--blue)}
.shake{animation:shake .35s}
@keyframes shake{25%{transform:translateX(-8px)}50%{transform:translateX(8px)}75%{transform:translateX(-4px)}}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pad button{height:62px;border-radius:12px;background:var(--bg);font-size:24px;font-weight:600}
.pad button:active{background:var(--blue-soft)}
.pad button.fn{font-size:15px;color:var(--muted)}
.bio-btn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;border-radius:12px;border:2px solid var(--blue);color:var(--blue);font-weight:700}
.bio-btn svg{width:26px;height:26px}
.linkbtn{color:var(--blue);font-weight:600;font-size:14px}
.demo-banner{background:var(--orange-soft);color:#7A4A00;font-size:13px;padding:8px 14px;text-align:center}

/* ---------- app shell ---------- */
.shell{display:flex;height:100%}
.side{width:248px;flex:none;background:linear-gradient(180deg,var(--blue-2),var(--blue-3));color:#fff;display:flex;flex-direction:column;padding:18px 12px;gap:6px;overflow-y:auto}
.brand{display:flex;align-items:center;gap:10px;padding:2px 8px 16px}
.brand img{height:40px}
.brand b{display:block;font-size:20px;letter-spacing:.3px}
.brand small{display:block;color:#BBD2F8;font-size:11px;margin-top:-2px}
.nav{display:grid;gap:4px}
.nav button{display:flex;align-items:center;gap:12px;padding:11px 14px;border-radius:10px;color:#E3ECFC;font-size:15px;text-align:left;width:100%}
.nav button:hover{background:rgba(255,255,255,.08)}
.nav button.on{background:var(--blue-pill);color:#fff;font-weight:600;box-shadow:0 4px 12px rgba(0,0,0,.15)}
.nav svg{width:21px;height:21px;flex:none}
.side .sep{height:1px;background:rgba(255,255,255,.18);margin:10px 8px}
.side .foot{margin-top:auto;font-size:12px;color:#A9C4F3;padding:8px}
.main{flex:1;min-width:0;display:flex;flex-direction:column;height:100%}
.top{display:flex;align-items:center;gap:12px;padding:10px 20px;background:#fff;border-bottom:1px solid var(--line);min-height:64px}
.shopchip{display:flex;align-items:center;gap:10px;padding:6px 12px;border:1px solid var(--line);border-radius:12px;min-width:0}
.shopchip img{height:30px;width:30px;object-fit:contain;border-radius:6px;background:var(--blue-soft)}
.shopchip b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shopchip small{color:var(--muted);font-size:12px}
.top .grow{flex:1}
.chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;font-size:13px;font-weight:600;background:var(--bg);white-space:nowrap}
.chip svg{width:17px;height:17px}
.chip.on{background:var(--green-soft);color:#0B7A50}
.chip.off{background:var(--orange-soft);color:#8A5300}
.me{display:flex;align-items:center;gap:10px;padding:4px 8px;border-radius:12px}
.me:hover{background:var(--bg)}
.me b{display:block;font-size:14px;text-align:left}
.content{flex:1;overflow:auto;padding:20px}
.pagehead{display:flex;align-items:center;gap:14px;margin-bottom:18px;flex-wrap:wrap}
.pagehead .ic{width:52px;height:52px;border-radius:12px;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;color:var(--blue)}
.pagehead .ic svg{width:28px;height:28px}
.pagehead h1{margin:0;font-size:26px}
.pagehead p{margin:0;color:var(--muted)}
.pagehead .actions{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:18px;min-width:0}
.card h3{margin:0 0 14px;font-size:17px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.stack{display:grid;gap:16px}
.kpi{display:flex;gap:16px;align-items:center}
.kpi .k-ic{width:58px;height:58px;border-radius:14px;display:grid;place-items:center;color:#fff;flex:none}
.kpi .k-ic svg{width:28px;height:28px}
.kpi span{color:var(--muted);font-size:14px}
.kpi b{display:block;font-size:26px;line-height:1.15}
.bg-blue{background:linear-gradient(135deg,#2F80F5,#1259D6)}.bg-green{background:linear-gradient(135deg,#25C08A,#119365)}
.bg-orange{background:linear-gradient(135deg,#FDB022,#F08C00)}.bg-purple{background:linear-gradient(135deg,#8B6CF0,#5B39D6)}
.bars{display:flex;align-items:flex-end;gap:12px;height:200px;padding-top:8px;border-bottom:1px solid var(--line)}
.bars .b{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;height:100%;min-width:0}
.bars .b i{display:block;width:100%;max-width:48px;border-radius:6px 6px 0 0;background:#76A9F7;min-height:2px}
.bars .b.today i{background:linear-gradient(180deg,#2F80F5,#1259D6)}
.bars .b small{font-size:11px;color:var(--muted);white-space:nowrap}
.blabels{display:flex;gap:12px;margin-top:6px}
.blabels span{flex:1;text-align:center;font-size:12px;color:var(--muted)}
.list{display:grid}
.li{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.li:last-child{border-bottom:0}
.li .grow{flex:1;min-width:0}
.li .grow b{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank{width:28px;height:28px;border-radius:50%;background:var(--blue-soft);color:var(--blue-2);display:grid;place-items:center;font-weight:700;font-size:13px;flex:none}
.meter{height:6px;background:var(--line);border-radius:6px;margin-top:6px;overflow:hidden}
.meter i{display:block;height:100%;background:var(--blue);border-radius:6px}
.pill{display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.pill.ok{background:var(--green-soft);color:#0B7A50}.pill.warn{background:var(--orange-soft);color:#8A5300}
.pill.bad{background:var(--red-soft);color:var(--red)}.pill.info{background:var(--blue-soft);color:var(--blue-2)}
.pill.gray{background:var(--bg);color:var(--muted)}
.empty{padding:28px;text-align:center;color:var(--muted)}
.tablewrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px}
th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:600;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:0}
td.r,th.r{text-align:right}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.toolbar .input{width:auto;min-width:160px}
.sumline{display:flex;gap:18px;flex-wrap:wrap;font-size:14px;color:var(--muted)}
.sumline b{color:var(--ink);font-size:16px}

/* ---------- caisse ---------- */
.pos{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:16px;height:100%}
.catalog{display:flex;flex-direction:column;gap:12px;min-height:0}
.search{position:relative}
.search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:20px;height:20px;color:var(--muted)}
.search input{padding-left:44px;min-height:52px;font-size:16px;border-radius:12px}
.cats{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px}
.cats button{padding:10px 18px;border-radius:999px;background:#fff;border:1px solid var(--line);font-weight:600;white-space:nowrap;font-size:14px}
.cats button.on{background:var(--blue);border-color:var(--blue);color:#fff}
.pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;overflow-y:auto;align-content:start;padding-bottom:12px;flex:1}
.ptile{background:#fff;border-radius:14px;box-shadow:var(--shadow);padding:12px;text-align:left;display:grid;gap:8px;border:2px solid transparent;min-height:132px;align-content:start}
.ptile:hover{border-color:#B9D1F8}
.ptile:active{transform:scale(.98)}
.ptile .ini{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;font-weight:800;color:#fff;font-size:18px}
.ptile b{font-size:14px;line-height:1.25}
.ptile .pr{font-weight:700;color:var(--blue-2)}
.ptile .st{font-size:12px}
.cart{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);display:flex;flex-direction:column;min-height:0;overflow:hidden}
.cart-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.cart-head b{font-size:17px}
.cart-head>svg{width:22px;height:22px;color:var(--blue)}
.mcart{display:none}
.cart-lines{flex:1;overflow-y:auto;padding:4px 16px;min-height:120px}
.cl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:12px 0;border-bottom:1px solid var(--line)}
.cl b{font-weight:600;font-size:14px}
.cl .lt{text-align:right;font-weight:700}
.cl .q{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.qbtn{width:34px;height:34px;border-radius:9px;background:var(--bg);display:grid;place-items:center}
.qbtn svg{width:16px;height:16px}
.qv{min-width:34px;text-align:center;font-weight:700;color:var(--ink);font-size:15px}
.wbtn{padding:6px 10px;border-radius:8px;background:var(--blue-soft);color:var(--blue-2);font-weight:700;font-size:14px}
.cart-foot{border-top:1px solid var(--line);padding:14px 16px;display:grid;gap:10px;background:#FAFCFF}
.tot{display:flex;justify-content:space-between;align-items:baseline}
.tot.big b{font-size:30px;color:var(--blue-3)}
.paygrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.paygrid button{min-height:48px;border-radius:10px;border:1px solid var(--line);background:#fff;font-weight:600;font-size:13px;display:grid;justify-items:center;gap:2px;padding:6px 2px}
.paygrid button svg{width:20px;height:20px}
.paygrid button.on{border:2px solid var(--blue);background:var(--blue-soft);color:var(--blue-2)}
.no-session{display:grid;place-items:center;height:100%}

/* ---------- modal & toast ---------- */
#modal .back{position:fixed;inset:0;background:rgba(10,25,55,.45);display:grid;place-items:center;padding:16px;z-index:50;animation:fade .15s}
#modal .dlg{background:#fff;border-radius:18px;width:100%;max-width:480px;max-height:calc(100% - 20px);overflow:auto;padding:22px;box-shadow:0 24px 60px rgba(0,0,0,.3)}
#modal .dlg.wide{max-width:640px}
#modal .dlg h2{margin:0 0 16px;font-size:21px;display:flex;justify-content:space-between;align-items:center;gap:12px}
#modal .dlg .x{width:38px;height:38px;border-radius:10px;background:var(--bg);display:grid;place-items:center}
#modal .dlg .x svg{width:18px;height:18px}
.dlg-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}
.dlg-actions .btn{flex:1}
@keyframes fade{from{opacity:0}}
#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:60;display:grid;gap:8px;pointer-events:none;width:max-content;max-width:calc(100% - 32px)}
#toast div{background:var(--ink);color:#fff;padding:12px 18px;border-radius:12px;font-weight:600;box-shadow:0 10px 30px rgba(0,0,0,.25);animation:fade .2s}
#toast div.bad{background:var(--red)}
.bigtotal{text-align:center;padding:14px;background:var(--blue-soft);border-radius:14px}
.bigtotal span{color:var(--muted);font-size:14px}
.bigtotal b{display:block;font-size:38px;color:var(--blue-3)}
.quick{display:flex;gap:8px;flex-wrap:wrap}
.quick button{flex:1;min-width:70px;min-height:44px;border-radius:10px;background:var(--bg);font-weight:700}
.change{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-radius:12px;background:var(--green-soft);color:#0B7A50;font-weight:700;font-size:18px}
.change.neg{background:var(--red-soft);color:var(--red)}
.ticket-prev{font-family:"Courier New",monospace;font-size:13px;background:#FBFBF8;border:1px solid var(--line);border-radius:10px;padding:14px;max-height:50vh;overflow:auto;white-space:pre;line-height:1.35}

/* ---------- responsive ---------- */
@media(max-width:1180px){.grid4{grid-template-columns:repeat(2,minmax(0,1fr))}.grid3{grid-template-columns:1fr 1fr}.pos{grid-template-columns:minmax(0,1fr) 340px}}
@media(max-width:900px){
  .shell{flex-direction:column}
  .side{width:auto;flex-direction:row;order:2;padding:6px;gap:0;overflow-x:auto;overflow-y:hidden;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
  .side .brand,.side .sep,.side .foot,.side .navx{display:none}
  .nav{display:flex;gap:2px}
  .nav button{flex-direction:column;gap:2px;font-size:11px;padding:6px 10px;white-space:nowrap}
  .main{order:1;min-height:0}
  .top{padding:8px 12px}
  .top .hide-sm{display:none}
  .content{padding:14px}
  .pos{grid-template-columns:minmax(0,1fr);height:auto}
  .catalog{min-width:0}
  .mcart{display:flex;position:sticky;bottom:0;margin:12px -14px -14px;padding:10px 14px;background:rgba(241,245,252,.95);backdrop-filter:blur(6px);z-index:5}
  .mcart .btn{flex:1}
  .pgrid{overflow:visible;grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
  .cart{min-height:360px}
  .grid3,.grid2{grid-template-columns:1fr}
}
@media(max-width:520px){.grid4{grid-template-columns:1fr}.pagehead h1{font-size:22px}.paygrid{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ---------- printing (USB / Wi-Fi printers through the system driver) ---------- */
#print-area{display:none}
@media print{
  body>*:not(#print-area){display:none!important}
  #print-area{display:block!important;color:#000;background:#fff}
  .tk{font:12px/1.3 "Courier New",monospace;margin:0 auto;padding:2mm}
  .tk .c{text-align:center}.tk .b{font-weight:700}.tk .big{font-size:16px;font-weight:700}
  .tk .row{display:flex;justify-content:space-between;gap:6px}
  .tk .hr{border-top:1px dashed #000;margin:4px 0}
  .tk img{display:block;margin:0 auto 4px;max-width:60%;max-height:30mm;filter:grayscale(1) contrast(1.4)}
}
a.btn{text-decoration:none}
