:root{--g:#0f766e;--g2:#14b8a6;--gd:#0b4f4a;--bg:#f4f7f6;--card:#fff;--tx:#10201e;--mut:#5f6f6d;--bd:#e3ebe9;--red:#dc2626;--or:#ea580c;--yl:#f59e0b;--bl:#2563eb;--r:14px}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--tx);font-family:"Segoe UI",Tahoma,"Noto Sans Arabic","Geeza Pro",Arial,sans-serif;font-size:15px;line-height:1.5}
body{padding-bottom:76px;min-height:100vh}
a{color:var(--g);text-decoration:none}
button,input,select,textarea{font:inherit}
.top{position:sticky;top:0;z-index:20;background:linear-gradient(135deg,var(--gd),var(--g));color:#fff;padding:10px 14px;display:flex;align-items:center;gap:10px;box-shadow:0 2px 10px rgba(0,0,0,.12)}
.top h1{font-size:17px;margin:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top .logo{width:34px;height:34px;border-radius:10px;background:#fff;display:grid;place-items:center;flex:none}
.top .logo img{width:30px;height:30px}
.top button{background:rgba(255,255,255,.16);color:#fff;border:0;border-radius:10px;padding:7px 10px;cursor:pointer}
.role-chip{font-size:12px;background:rgba(255,255,255,.2);padding:3px 8px;border-radius:20px}
main{max-width:720px;margin:0 auto;padding:12px}
.card{background:var(--card);border:1px solid var(--bd);border-radius:var(--r);padding:14px;margin:0 0 12px;box-shadow:0 1px 3px rgba(16,32,30,.04)}
.row{display:flex;gap:10px;align-items:center}
.row.wrap{flex-wrap:wrap}.between{justify-content:space-between}
.grow{flex:1;min-width:0}
.mut{color:var(--mut);font-size:13px}
.small{font-size:12px}
h2{font-size:18px;margin:4px 0 12px}h3{font-size:16px;margin:0 0 8px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:12px;padding:11px 16px;background:var(--g);color:#fff;font-weight:600;cursor:pointer;text-align:center}
.btn.block{display:flex;width:100%}
.btn.sec{background:#e6f2f0;color:var(--gd)}
.btn.red{background:#fee2e2;color:var(--red)}
.btn.or{background:var(--or)}
.btn.sm{padding:7px 11px;font-size:13px;border-radius:10px}
.btn:disabled{opacity:.55}
label{display:block;font-size:13px;color:var(--mut);margin:10px 0 4px}
input,select,textarea{width:100%;border:1px solid var(--bd);border-radius:12px;padding:11px 12px;background:#fff;color:var(--tx);outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--g2);box-shadow:0 0 0 3px rgba(20,184,166,.15)}
textarea{min-height:70px;resize:vertical}
.nav{position:fixed;bottom:0;left:0;right:0;z-index:30;background:#fff;border-top:1px solid var(--bd);display:flex;justify-content:space-around;padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.nav a{flex:1;text-align:center;color:var(--mut);font-size:11px;padding:4px 0;position:relative}
.nav a .i{display:block;font-size:21px;line-height:1.2}
.nav a.on{color:var(--g);font-weight:700}
.badge{position:absolute;top:0;left:50%;margin-left:6px;background:var(--red);color:#fff;border-radius:10px;font-size:10px;padding:0 5px;min-width:16px}
.cats{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}
.cats::-webkit-scrollbar{display:none}
.cat{flex:none;border:1px solid var(--bd);background:#fff;border-radius:22px;padding:7px 13px;font-size:13px;cursor:pointer;white-space:nowrap}
.cat.on{background:var(--g);color:#fff;border-color:var(--g)}
.stores{display:grid;grid-template-columns:1fr;gap:10px}
@media(min-width:560px){.stores{grid-template-columns:1fr 1fr}}
.store{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--bd);border-radius:var(--r);padding:10px;color:var(--tx)}
.thumb{width:64px;height:64px;border-radius:12px;background:#e6f2f0;display:grid;place-items:center;font-size:28px;overflow:hidden;flex:none}
.thumb img{width:100%;height:100%;object-fit:cover}
.pill{display:inline-block;font-size:11px;padding:2px 8px;border-radius:20px;background:#e6f2f0;color:var(--gd);font-weight:600}
.pill.red{background:#fee2e2;color:var(--red)}.pill.or{background:#ffedd5;color:var(--or)}.pill.bl{background:#dbeafe;color:var(--bl)}.pill.yl{background:#fef3c7;color:#92400e}.pill.gr{background:#dcfce7;color:#166534}.pill.gy{background:#eef0f0;color:#555}
.prod{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--bd)}
.prod:last-child{border-bottom:0}
.price{font-weight:700;color:var(--gd);white-space:nowrap}
.qty{display:flex;align-items:center;gap:6px}
.qty button{width:30px;height:30px;border-radius:9px;border:1px solid var(--bd);background:#fff;font-size:17px;cursor:pointer;line-height:1}
.qty b{min-width:18px;text-align:center}
.cartbar{position:fixed;bottom:66px;left:12px;right:12px;max-width:696px;margin:0 auto;z-index:25}
.hero{background:linear-gradient(135deg,var(--gd),var(--g2));color:#fff;border-radius:18px;padding:18px;margin-bottom:12px}
.hero h2{margin:0 0 4px;font-size:20px}
.roles{display:grid;gap:12px}
.rolecard{display:flex;gap:14px;align-items:center;background:#fff;border:2px solid var(--bd);border-radius:18px;padding:16px;color:var(--tx);cursor:pointer}
.rolecard .em{font-size:38px}
.rolecard:active{border-color:var(--g2)}
.tl{list-style:none;margin:8px 0 0;padding:0}
.tl li{position:relative;padding:0 26px 14px 0;color:var(--mut)}
.tl li:before{content:"";position:absolute;right:6px;top:5px;width:12px;height:12px;border-radius:50%;background:#d6dfdd}
.tl li:after{content:"";position:absolute;right:11px;top:19px;bottom:0;width:2px;background:#e3ebe9}
.tl li:last-child:after{display:none}
.tl li.done{color:var(--tx)}.tl li.done:before{background:var(--g2)}
.tl li.cur{color:var(--tx);font-weight:700}.tl li.cur:before{background:var(--or);box-shadow:0 0 0 4px #ffedd5}
.toast{position:fixed;top:64px;left:50%;transform:translateX(-50%);background:#10201e;color:#fff;padding:10px 16px;border-radius:12px;z-index:99;max-width:90%;font-size:14px;box-shadow:0 6px 20px rgba(0,0,0,.2)}
.big{font-size:28px;font-weight:800;color:var(--gd)}
.refbox{border:2px dashed var(--g2);border-radius:14px;padding:12px;text-align:center;background:#f0fbf9}
.refbox .code{font-size:30px;letter-spacing:4px;font-weight:800;color:var(--gd);direction:ltr}
.toggle{display:flex;align-items:center;justify-content:space-between;padding:16px;border-radius:16px;color:#fff;font-weight:700;font-size:18px;cursor:pointer}
.toggle.on{background:linear-gradient(135deg,#15803d,#22c55e)}.toggle.off{background:linear-gradient(135deg,#475569,#94a3b8)}
.empty{text-align:center;color:var(--mut);padding:30px 10px}
.empty .em{font-size:42px}
.ltr{direction:ltr;unicode-bidi:embed}
.map{height:240px;border-radius:12px;overflow:hidden;margin-top:8px;border:1px solid var(--bd)}
.seg{display:flex;background:#e6f2f0;border-radius:12px;padding:3px;gap:3px}
.seg button{flex:1;border:0;background:transparent;padding:8px;border-radius:10px;cursor:pointer;color:var(--gd)}
.seg button.on{background:#fff;font-weight:700;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.pay{border:1px solid var(--bd);border-radius:12px;padding:10px;margin:6px 0;display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.pay.on{border-color:var(--g2);background:#f0fbf9}
.pay input{width:auto;margin-top:4px}
hr{border:0;border-top:1px solid var(--bd);margin:12px 0}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{padding:8px 6px;border-bottom:1px solid var(--bd);text-align:right;vertical-align:top}
th{color:var(--mut);font-weight:600;background:#fafcfb}
.kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:12px}
@media(min-width:720px){.kpis{grid-template-columns:repeat(4,1fr)}}
.kpi{background:#fff;border:1px solid var(--bd);border-radius:14px;padding:12px}
.kpi .v{font-size:24px;font-weight:800;color:var(--gd)}
.kpi .l{font-size:12px;color:var(--mut)}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-left:5px;vertical-align:middle}
.dot.on{background:#22c55e;box-shadow:0 0 0 3px #dcfce7}.dot.idle{background:var(--yl)}.dot.off{background:#94a3b8}.dot.pend{background:var(--or)}
.spinner{width:26px;height:26px;border:3px solid #cfe7e3;border-top-color:var(--g);border-radius:50%;animation:sp 1s linear infinite;margin:30px auto}
@keyframes sp{to{transform:rotate(360deg)}}
.imgpick{width:84px;height:84px;border-radius:12px;border:2px dashed var(--bd);display:grid;place-items:center;overflow:hidden;cursor:pointer;background:#fafcfb;color:var(--mut);font-size:12px;text-align:center}
.imgpick img{width:100%;height:100%;object-fit:cover}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:60;display:flex;align-items:flex-end;justify-content:center}
.modal .sheet{background:#fff;width:100%;max-width:720px;max-height:92vh;overflow:auto;border-radius:18px 18px 0 0;padding:16px}
