*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:Inter,Arial,sans-serif;background:#f3f5f7;color:#17202a}button,input,textarea,select{font:inherit}.hidden{display:none!important}.login{height:100%;display:grid;place-items:center;background:#eef2f5}.login-card{width:min(420px,92vw);background:#fff;padding:36px;border-radius:18px;box-shadow:0 16px 55px #10233a1c}.logo{font-weight:900;font-size:29px}.login-card h1{margin:24px 0 8px}.login-card p{margin:0 0 22px;color:#697586}.login-card input{width:100%;padding:13px;border:1px solid #ced6df;border-radius:10px;margin-top:10px}.login-card button{width:100%;margin-top:12px;border:0;padding:13px;border-radius:10px;background:#0f6fc6;color:#fff;font-weight:700}.error-text{color:#b42318;margin-top:10px;font-size:13px}.shell{height:100vh;height:100dvh;display:grid;grid-template-columns:230px 1fr}.sidebar{background:#0B1D33;color:#eaf1f7;display:flex;flex-direction:column}.brand{height:76px;display:flex;align-items:center;gap:11px;padding:0 18px;border-bottom:1px solid #ffffff18}.brandmark{width:40px;height:40px;border-radius:11px;background:#fff;display:grid;place-items:center;overflow:hidden;padding:4px}.brandmark img{width:100%;height:100%;object-fit:contain}.login-brand{height:58px;display:flex;align-items:center}.login-brand img{display:block;width:min(310px,100%);height:auto;max-height:58px;object-fit:contain;object-position:left center}.brand b{display:block;font-size:17px}.brand span{display:block;font-size:11px;color:#91a8bd;margin-top:2px}.sidebar nav{padding:14px 9px}.nav,.ghost{width:100%;border:0;background:transparent;color:#c9d6e2;text-align:left;padding:11px 13px;border-radius:9px;cursor:pointer;margin:2px 0}.nav span{width:27px;display:inline-block}.nav.active,.nav:hover{background:#ffffff15;color:#fff}.nav i{float:right;background:#d92d20;color:#fff;border-radius:12px;padding:1px 6px;font-size:11px;font-style:normal;display:none}.side-bottom{margin-top:auto;padding:12px;border-top:1px solid #ffffff18}.ghost{font-size:13px}main{min-width:0;display:flex;flex-direction:column}.top{height:76px;background:#fff;border-bottom:1px solid #e2e7ec;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.top h1{font-size:22px;margin:0}.muted{color:#7b8794;font-size:12px;margin-top:3px}.pill{font-size:12px;padding:6px 9px;border-radius:16px;background:#ecfdf3;color:#027a48}.content{padding:20px;overflow:auto;flex:1}.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.stat{background:#fff;border:1px solid #e5e9ee;border-radius:14px;padding:20px}.stat .n{font-size:31px;font-weight:800}.stat .l{font-size:13px;color:#667085;margin-top:5px}.panel{background:#fff;border:1px solid #e4e9ee;border-radius:14px;overflow:hidden}.toolbar{padding:12px;display:flex;gap:8px;align-items:center;border-bottom:1px solid #e7ebef;flex-wrap:wrap}.toolbar input,.toolbar select{border:1px solid #ccd5df;border-radius:8px;padding:9px 10px;background:#fff}.toolbar input.search{min-width:280px;flex:1}.btn{border:0;border-radius:8px;padding:9px 13px;cursor:pointer;font-weight:700}.btn.primary{background:#0f6fc6;color:#fff}.btn.secondary{background:#eef3f7;color:#25364a}.btn.danger{background:#fff0ef;color:#b42318}.table-wrap{overflow:auto}.data{width:100%;border-collapse:collapse;font-size:13px}.data th{position:sticky;top:0;background:#f8fafb;color:#667085;text-align:left;font-weight:650;padding:10px;border-bottom:1px solid #e6eaee;white-space:nowrap}.data td{padding:10px;border-bottom:1px solid #edf0f3;vertical-align:middle}.data tr:hover{background:#fafcff}.cell-edit{border:1px solid transparent;background:transparent;padding:6px;border-radius:6px;width:100%;min-width:90px}.cell-edit:focus{border-color:#72aee6;background:#fff;outline:none}.stock-neg{color:#b42318;font-weight:700}.stock-zero{color:#b54708}.pager{display:flex;justify-content:space-between;align-items:center;padding:11px 13px;border-top:1px solid #e7ebef}.split{height:calc(100vh - 117px);height:calc(100dvh - 117px);display:grid;grid-template-columns:330px 1fr;background:#fff;border:1px solid #e4e9ee;border-radius:14px;overflow:hidden}.threads{border-right:1px solid #e2e7ec;display:flex;flex-direction:column;min-width:0}.thread-list{overflow:auto}.thread{padding:13px 14px;border-bottom:1px solid #eef1f4;cursor:pointer}.thread:hover,.thread.active{background:#eef6ff}.thread-head{display:flex;gap:8px;justify-content:space-between}.thread-name{font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thread-time{font-size:11px;color:#8994a3}.thread-preview{font-size:12px;color:#6b7788;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.unread{display:inline-block;background:#0f6fc6;color:#fff;border-radius:11px;min-width:20px;text-align:center;padding:2px 5px;font-size:10px}.chatpane{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.chathead{height:64px;padding:12px 17px;border-bottom:1px solid #e2e7ec;display:flex;align-items:center;gap:10px}.chat-back{display:none;border:0;background:#eef3f7;border-radius:9px;width:38px;height:38px;font-size:22px;color:#25364a}.chathead b{display:block}.messages{flex:1;min-height:0;overflow:auto;background:#f4f6f8;padding:18px;display:flex;flex-direction:column;gap:9px}.bubble{max-width:72%;padding:9px 12px;border-radius:12px;background:#fff;align-self:flex-start;box-shadow:0 1px 2px #0000000c;white-space:pre-wrap}.bubble.out{background:#dcefff;align-self:flex-end}.bubble time{font-size:10px;color:#7e8997;display:block;text-align:right;margin-top:4px}.composer{display:flex;flex:0 0 auto;gap:8px;padding:11px;border-top:1px solid #e2e7ec}.composer textarea{flex:1;border:1px solid #cdd6df;border-radius:9px;padding:10px;resize:none}.drawer-back{position:fixed;inset:0;background:#10182866;z-index:10}.drawer{position:absolute;right:0;top:0;height:100%;width:min(720px,94vw);background:#fff;display:flex;flex-direction:column;box-shadow:-16px 0 50px #0002}.drawer-head{padding:17px 20px;border-bottom:1px solid #e4e9ee;display:flex;justify-content:space-between}.drawer-body{padding:18px 20px;overflow:auto;flex:1}.drawer-foot{padding:13px 20px;border-top:1px solid #e4e9ee;display:flex;justify-content:flex-end;gap:8px}.field{margin-bottom:14px}.field label{font-size:12px;color:#667085;display:block;margin-bottom:5px}.field input,.field textarea,.field select{width:100%;padding:9px;border:1px solid #ccd5df;border-radius:8px}.pos-row{display:grid;grid-template-columns:1fr 90px 110px 36px;gap:7px;align-items:center;padding:7px 0;border-bottom:1px solid #eef1f4}.pos-row input{width:100%;padding:7px;border:1px solid #d2d9e1;border-radius:7px}.toast{position:fixed;right:20px;bottom:20px;background:#172b3f;color:#fff;padding:11px 15px;border-radius:9px;box-shadow:0 10px 30px #0003;opacity:0;transform:translateY(10px);transition:.2s;pointer-events:none;z-index:30}.toast.show{opacity:1;transform:none}@media(max-width:900px){.shell{grid-template-columns:70px 1fr}.brand>div:last-child,.nav{font-size:0}.nav span{font-size:18px}.sidebar .brand{padding:0 15px}.cards{grid-template-columns:1fr}.split{grid-template-columns:260px 1fr}}@media(max-width:650px){.sidebar{display:none}.shell{grid-template-columns:1fr}.top{height:64px;padding:0 14px}.content{padding:8px;min-height:0}.split{grid-template-columns:1fr;height:calc(100dvh - 80px)}.threads{display:flex;border-right:0}.chatpane{display:none}.split.mobile-chat-open .threads{display:none}.split.mobile-chat-open .chatpane{display:flex}.chat-back{display:inline-grid;place-items:center}.toolbar input.search{min-width:100%}.composer{padding-bottom:max(11px,env(safe-area-inset-bottom))}.messages{padding:12px}.bubble{max-width:88%}}

/* v0.2 notifications */
.notif-offer{position:fixed;right:22px;bottom:22px;z-index:10000;max-width:520px;background:#fff;border:1px solid #e4e7ec;border-radius:14px;box-shadow:0 18px 50px rgba(16,24,40,.18);padding:14px 16px;display:flex;gap:10px;align-items:center}
.notif-offer>div{display:flex;flex-direction:column;gap:2px;flex:1;min-width:220px}.notif-offer span{font-size:13px;color:#667085}
@media(max-width:720px){.notif-offer{left:12px;right:12px;bottom:12px;flex-wrap:wrap}.notif-offer>div{flex-basis:100%}}

/* v0.4 Web Push */
.ghost.attention{background:#fff3cd;color:#fff;font-weight:800;box-shadow:0 0 0 2px #fdb02255 inset}.notif-offer.important{border:2px solid #f79009}.notif-offer.important b{font-size:16px}.notif-offer.important .primary{white-space:nowrap}

/* v0.5 account auth */
.user-actions{display:flex;gap:6px;flex-wrap:wrap}.manager-drawer{width:min(480px,94vw)}
@media(max-width:650px){.login-card{padding:26px 20px}.user-actions{min-width:190px}}

.mobile-nav,.mobile-more,.mobile-menu{display:none}
@media(max-width:650px){
  .shell{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  .top{position:sticky;top:0;z-index:20}
  .top h1{font-size:19px}.top .muted{max-width:64vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-more{display:inline-grid;place-items:center;border:0;background:#eef3f7;color:#25364a;border-radius:10px;width:38px;height:38px;font-size:24px;line-height:1;cursor:pointer}
  .mobile-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;background:#0B1D33;border-top:1px solid #ffffff18;padding:5px 4px max(5px,env(safe-area-inset-bottom));box-shadow:0 -8px 24px #0b1d3324}
  .mobile-nav .mobile-nav-item{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:7px 2px;margin:0;border-radius:9px;text-align:center;color:#b9c8d7;font-size:0}
  .mobile-nav .mobile-nav-item span{width:auto;font-size:19px;line-height:1.15}
  .mobile-nav .mobile-nav-item b{display:block;max-width:100%;font-size:10px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mobile-nav .mobile-nav-item.active{background:#ffffff15;color:#fff}
  .mobile-nav .mobile-nav-item i{position:absolute;margin-left:23px;margin-top:-27px;background:#d92d20;color:#fff;border-radius:12px;padding:1px 5px;font-size:9px;font-style:normal;display:none}
  .mobile-menu{display:flex;position:fixed;right:10px;top:58px;z-index:60;min-width:205px;flex-direction:column;background:#fff;border:1px solid #e4e9ee;border-radius:12px;box-shadow:0 15px 45px #1018282b;padding:7px}
  .mobile-menu.hidden{display:none!important}
  .mobile-menu-btn{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:8px;color:#25364a}
  .mobile-menu-btn:active{background:#eef3f7}.danger-text{color:#b42318}
  .content{padding-bottom:12px}
  .drawer{width:100vw;max-width:100vw}
  .manager-drawer{width:100vw;max-width:100vw}
  .drawer-foot{padding-bottom:max(13px,env(safe-area-inset-bottom))}
  .user-actions{min-width:185px}
}

/* v0.5.2 responsive layout hardening */
html,body{width:100%;max-width:100%;overflow:hidden}
.shell{width:100%;max-width:100%;min-width:0;overflow:hidden}
main{min-width:0;max-width:100%;overflow:hidden}
.top-actions{display:flex;align-items:center;gap:8px;min-width:0}
.content{min-width:0;max-width:100%}
.panel,.stat,.toolbar,.table-wrap{min-width:0;max-width:100%}
.table-wrap{overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.data{min-width:720px}
.quick-actions{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap}
.quick-actions .btn{white-space:nowrap}
.drawer-back{z-index:80}
.drawer{max-width:100vw}
.drawer-head>div{min-width:0}.drawer-head b,.drawer-head .muted{overflow-wrap:anywhere}
.composer textarea{min-width:0}
.pos-row>div{min-width:0;overflow-wrap:anywhere}

/* normal desktop */
@media (min-width:1101px){
  .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* small desktop / landscape tablet */
@media (min-width:651px) and (max-width:1100px){
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:651px) and (max-width:900px){
  .side-bottom{padding:8px 6px}
  .side-bottom .ghost{font-size:0;text-align:center;padding:10px 4px;min-height:38px}
  #notifyBtn::before{content:'🔔';font-size:17px}
  #soundBtn::before{content:'🔊';font-size:17px}
  #logoutBtn::before{content:'↪';font-size:18px}
}

@media(max-width:650px){
  .shell{height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));overflow:hidden}
  main{height:100%;min-height:0}
  .top{flex:0 0 64px}
  .content{min-height:0;overflow:auto;padding:8px 8px 10px}
  .cards{grid-template-columns:1fr;gap:8px}
  .stat{padding:14px}.stat .n{font-size:26px}.stat .l{font-size:12px}
  .panel{border-radius:11px}
  .toolbar{padding:9px;gap:6px;align-items:stretch}
  .toolbar input,.toolbar select,.toolbar .btn{max-width:100%}
  .toolbar input.search{width:100%;min-width:0;flex:1 1 100%}
  .quick-actions{gap:6px}.quick-actions .btn{flex:1 1 auto}
  .split{height:calc(100dvh - 144px - env(safe-area-inset-bottom));min-height:0;border-radius:11px}
  .chathead{height:auto;min-height:58px;padding:9px 10px}.chathead>div{min-width:0}.chathead .muted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:72vw}
  .messages{padding:10px}.bubble{max-width:90%;overflow-wrap:anywhere}
  .composer{gap:6px;padding:8px;padding-bottom:max(8px,env(safe-area-inset-bottom))}
  .composer .btn{padding:9px 10px;white-space:nowrap}
  .drawer{width:100vw;max-width:100vw}
  .drawer-head{padding:13px 14px;gap:8px}.drawer-body{padding:13px 14px}.drawer-foot{padding:10px 14px max(10px,env(safe-area-inset-bottom));flex-wrap:wrap}
  .drawer-foot .btn{flex:1 1 130px}
  .pos-row{grid-template-columns:minmax(0,1fr) 72px 36px;gap:6px}
  .pos-row .oqty{grid-column:2;grid-row:1}
  .pos-row .premove{grid-column:3;grid-row:1}
  .pos-row .oprice{grid-column:1/3;grid-row:2}
  .toast{left:12px;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));text-align:center}
  .notif-offer{bottom:calc(76px + env(safe-area-inset-bottom))}
  .pager{gap:8px;flex-wrap:wrap;padding:9px}.pager>div{margin-left:auto}
  .data{min-width:680px}
  .mobile-nav .mobile-nav-item{position:relative}
  .mobile-menu{max-width:calc(100vw - 20px)}
}
@media(max-width:430px){
  .top h1{font-size:18px}.top .muted{font-size:11px;max-width:58vw}
  .mobile-nav .mobile-nav-item b{font-size:9px}
  .mobile-nav .mobile-nav-item span{font-size:18px}
  .login-card{width:calc(100vw - 24px);padding:24px 18px;border-radius:14px}
  .login-card h1{font-size:24px;margin-top:18px}
}
@media(max-width:380px){
  .pill{font-size:0;width:28px;height:28px;padding:0;display:grid;place-items:center}
  .pill::before{content:'●';font-size:12px}
  .top{padding:0 10px}.top .muted{max-width:55vw}
  .mobile-nav{padding-left:2px;padding-right:2px}
  .mobile-nav .mobile-nav-item{padding-left:0;padding-right:0}
  .mobile-nav .mobile-nav-item b{font-size:8.5px}
  .composer .btn{padding-left:8px;padding-right:8px;font-size:12px}
}
@media(max-width:340px){
  .mobile-nav .mobile-nav-item b{display:none}
  .mobile-nav .mobile-nav-item span{font-size:20px}
  .mobile-nav .mobile-nav-item{padding-top:9px;padding-bottom:9px}
  .top .muted{display:none}
}

/* v0.5.3 native back + swipe-close interaction */
.drawer-head,.chathead{-webkit-user-select:none;user-select:none;touch-action:pan-y}
.action-dialog{width:min(460px,94vw)}
.dialog-message{font-size:14px;line-height:1.45;color:#344054;overflow-wrap:anywhere}
@media(max-width:650px){
  .action-dialog{width:100vw;max-width:100vw}
  .drawer-head,.chathead{touch-action:pan-y}
}


/* v0.5.4 account context + mobile menu clarity */
.desktop-account{padding:2px 13px 10px;color:#dbe7f1;font-size:12px;line-height:1.35;border-bottom:1px solid #ffffff12;margin-bottom:6px}
.desktop-account b{display:block;color:#fff;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.desktop-account span{display:block;color:#91a8bd;font-size:10px;margin-top:2px}
.mobile-account-chip{display:none;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700;color:#334155;background:#eef3f7;border-radius:14px;padding:6px 8px}
.mobile-menu-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 8px 9px 12px;border-bottom:1px solid #e7ebef;margin-bottom:4px}
.mobile-menu-head b{display:block;color:#17202a;font-size:13px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-menu-head span{display:block;color:#7b8794;font-size:10px;margin-top:2px}
.mobile-menu-close{width:34px;height:34px;flex:0 0 34px;border:0;border-radius:9px;background:#eef3f7;color:#25364a;font-size:18px;display:grid;place-items:center;padding:0;cursor:pointer}
@media (max-width:650px){.mobile-account-chip{display:inline-block}.top-actions{gap:6px}.mobile-menu{min-width:245px}.mobile-menu-btn{font-size:14px}.danger-text{font-weight:700}}
@media (max-width:390px){.mobile-account-chip{max-width:72px;padding:6px 7px}.pill{padding:6px 7px;font-size:0}.pill::first-letter{font-size:12px}.top{padding-left:14px;padding-right:10px}.top h1{font-size:20px}}
@media (max-width:340px){.mobile-account-chip{max-width:58px}.mobile-menu{right:6px;max-width:calc(100vw - 12px);min-width:230px}}

/* v0.5.6 live chat presence */
.chat-typing{display:block;min-height:18px;margin-top:2px;font-size:12px;font-weight:600;color:#F58214;line-height:1.35}
.message-sender{font-size:11px;font-weight:700;opacity:.72;margin-bottom:3px}
@media(max-width:650px){.chat-typing{font-size:11px;max-width:72vw;white-space:normal}}
