:root{--bg:#f6f7fb;--card:#fff;--txt:#111827;--mut:#6b7280;--pri:#111827;--line:#e5e7eb;--ok:#16a34a;--bad:#dc2626}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:var(--bg);color:var(--txt)}a{text-decoration:none;color:inherit}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.box{background:var(--card);border-radius:24px;padding:24px;box-shadow:0 20px 60px #0001;width:100%;max-width:420px}.brand{font-weight:900;font-size:26px;margin-bottom:6px}.muted{color:var(--mut);font-size:14px}input,select,textarea{width:100%;padding:13px;border:1px solid var(--line);border-radius:14px;margin:7px 0 14px;background:#fff}button,.btn{border:0;background:var(--pri);color:#fff;padding:12px 16px;border-radius:14px;font-weight:800;cursor:pointer;display:inline-flex;gap:8px;align-items:center}.btn.light{background:#fff;color:#111;border:1px solid var(--line)}.btn.ok{background:var(--ok)}.btn.bad{background:var(--bad)}.app{display:flex;min-height:100vh}.side{width:250px;background:#111827;color:#fff;padding:18px;position:sticky;top:0;height:100vh}.side h2{margin:0 0 20px}.side a{display:block;padding:12px;border-radius:12px;color:#d1d5db;margin:3px 0}.side a:hover,.side a.active{background:#ffffff18;color:#fff}.main{flex:1;padding:22px}.top{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:18px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:0 10px 30px #00000008}.card h3{margin:0 0 8px;font-size:14px;color:var(--mut)}.big{font-size:24px;font-weight:900}.table{width:100%;border-collapse:collapse;background:#fff;border-radius:18px;overflow:hidden}.table th,.table td{padding:12px;border-bottom:1px solid var(--line);text-align:left}.pos{display:grid;grid-template-columns:1.4fr .8fr;gap:16px}.products{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.product{background:#fff;border:1px solid var(--line);border-radius:18px;padding:14px;cursor:pointer}.product:hover{border-color:#111}.cart-item{display:flex;justify-content:space-between;border-bottom:1px dashed var(--line);padding:10px 0;gap:10px}.cart-total{font-size:26px;font-weight:900;margin:14px 0}.pill{font-size:12px;padding:5px 9px;border-radius:999px;background:#eef2ff}.notice{padding:12px 14px;border-radius:14px;background:#fff7ed;border:1px solid #fed7aa;margin-bottom:14px}@media(max-width:900px){.app{display:block}.side{width:100%;height:auto;position:relative}.grid{grid-template-columns:repeat(2,1fr)}.pos{grid-template-columns:1fr}.products{grid-template-columns:repeat(2,1fr)}}


/* Webview / tablet POS mode */
body.pos-webview{background:#f3f4f6;overflow-x:hidden}.pos-webview .app{display:block;min-height:100vh}.pos-webview .main{padding:12px;max-width:100vw}.pos-header{position:sticky;top:0;z-index:50;background:#111827;color:#fff;border-radius:0 0 22px 22px;padding:12px 14px;margin:-12px -12px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 10px 30px #0002}.pos-header h1{font-size:18px;line-height:1.1;margin:0}.pos-header .muted{color:#d1d5db}.pos-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.pos-actions .btn{padding:10px 12px;border-radius:12px}.pos-webview .top{display:none}.pos-webview .grid.shift-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.pos-webview .grid.shift-grid .card{padding:12px;border-radius:16px}.pos-webview .grid.shift-grid .big{font-size:18px}.pos-webview .pos{grid-template-columns:minmax(0,1fr) 420px;gap:12px;align-items:start}.pos-webview aside{position:sticky;top:74px}.pos-webview .card{border-radius:18px}.pos-webview .products{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;max-height:calc(100vh - 230px);overflow:auto;padding:2px}.pos-webview .product{min-height:112px;padding:12px;border-radius:16px;touch-action:manipulation}.pos-webview input,.pos-webview select,.pos-webview textarea{padding:12px;margin:5px 0 10px;border-radius:12px}.pos-webview button,.pos-webview .btn{min-height:44px}.cart-panel{max-height:calc(100vh - 95px);overflow:auto}.cart-summary{position:sticky;bottom:0;background:#fff;padding-top:10px;border-top:1px solid var(--line)}.mobile-only{display:none}.desktop-only{display:block}
@media(max-width:980px){.pos-webview .pos{grid-template-columns:1fr}.pos-webview aside{position:relative;top:auto}.pos-webview .products{max-height:none;grid-template-columns:repeat(2,minmax(0,1fr))}.pos-webview .grid.shift-grid{grid-template-columns:repeat(2,1fr)}.cart-panel{max-height:none}.mobile-only{display:block}.desktop-only{display:none}}
@media(max-width:520px){.pos-header{border-radius:0 0 18px 18px}.pos-header h1{font-size:16px}.pos-actions .btn{font-size:12px;padding:8px 10px}.pos-webview .main{padding:10px}.pos-webview .products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.pos-webview .product{padding:10px;min-height:106px}.pos-webview .grid.shift-grid .big{font-size:16px}.pos-webview .card{padding:12px}.cart-total{font-size:22px}}
