:root{--accent:#6d5dfc;--accent2:#8c7cff;--bg:#f5f6fb;--card:#fff;--text:#17181d;--muted:#727582;--line:#e9eaf2;--danger:#e64b59;--success:#159b67;--shadow:0 18px 55px rgba(35,31,80,.14)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,Arial,sans-serif;background:var(--bg);color:var(--text)}
body{overscroll-behavior:none}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.splash{position:fixed;inset:0;z-index:9999;display:grid;place-content:center;justify-items:center;gap:12px;background:linear-gradient(145deg,#f7f6ff,#fff)}
.brand-mark{width:72px;height:72px;border-radius:24px;display:grid;place-items:center;background:linear-gradient(145deg,var(--accent),#9b8eff);color:#fff;font-size:34px;font-weight:900;box-shadow:0 18px 40px rgba(109,93,252,.28)}
.brand-mark.small{width:42px;height:42px;border-radius:14px;font-size:20px;box-shadow:none}
.splash-title{font-size:28px;font-weight:900}
.spinner{width:30px;height:30px;border:3px solid #e6e3ff;border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.app-shell{min-height:100vh;padding-bottom:92px}
.topbar{position:sticky;top:0;z-index:20;height:72px;padding:12px max(18px,env(safe-area-inset-left));display:flex;align-items:center;justify-content:space-between;background:rgba(245,246,251,.88);backdrop-filter:blur(18px);border-bottom:1px solid rgba(233,234,242,.8)}
.brand{display:flex;align-items:center;gap:10px}
.brand>div:last-child{display:flex;flex-direction:column}
.brand strong{font-size:19px}.brand span{font-size:12px;color:var(--muted)}
.icon-btn{width:44px;height:44px;border:0;border-radius:15px;background:#fff;box-shadow:0 5px 16px rgba(20,20,35,.07);font-size:19px}
.home{width:min(100%,980px);margin:auto;padding:18px}
.hero-card{background:linear-gradient(135deg,#252334,#414052);color:#fff;border-radius:28px;padding:24px;display:flex;justify-content:space-between;gap:16px;align-items:end;box-shadow:var(--shadow)}
.hero-card h1{margin:4px 0 7px;font-size:27px}.hero-card p{margin:0;color:#d9d9df;font-size:14px}.eyebrow{font-size:11px;font-weight:800;color:var(--accent);letter-spacing:.3px}
.hero-card .eyebrow{color:#bdb5ff}
.primary{border:0;background:var(--accent);color:#fff;border-radius:16px;padding:14px 18px;font-weight:850;box-shadow:0 10px 24px rgba(109,93,252,.24)}
.primary.compact{white-space:nowrap;padding:12px 15px}
.secondary{border:1px solid var(--line);background:#fff;color:var(--text);border-radius:15px;padding:12px 15px;font-weight:800}
.danger{border:0;background:#fff0f1;color:var(--danger);border-radius:14px;padding:11px 14px;font-weight:800}
.text-btn{border:0;background:transparent;color:var(--accent);font-weight:850;padding:8px}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px 0}
.stat-card{border:0;text-align:right;background:#fff;border-radius:20px;padding:16px;box-shadow:0 8px 26px rgba(26,27,42,.05)}
.stat-card span{display:block;color:var(--muted);font-size:12px}.stat-card strong{display:block;margin:5px 0;font-size:23px}.stat-card small{color:#a0a3ad}
.section-head{display:flex;justify-content:space-between;align-items:end;margin:24px 2px 12px}.section-head.inline{margin:0 0 12px}.section-head h2{font-size:18px;margin:3px 0 0}
.quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.quick-card{border:0;background:#fff;border-radius:20px;padding:18px 12px;display:flex;flex-direction:column;align-items:center;gap:9px;font-weight:850;box-shadow:0 8px 26px rgba(26,27,42,.05)}
.quick-card b{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:#f1efff;color:var(--accent);font-size:20px}
.recent-card{background:#fff;border-radius:24px;padding:18px;margin-top:18px;box-shadow:0 8px 26px rgba(26,27,42,.05)}
.list-stack{display:flex;flex-direction:column;gap:9px}.empty-state{color:var(--muted);padding:22px;text-align:center}
.list-row{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid var(--line);border-radius:16px}.list-row .grow{flex:1;min-width:0}.list-row strong,.list-row span{display:block}.list-row small{color:var(--muted)}
.bottom-nav{position:fixed;bottom:0;left:50%;z-index:30;transform:translateX(-50%);width:min(100%,700px);padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr);background:rgba(255,255,255,.96);backdrop-filter:blur(18px);border:1px solid var(--line);border-bottom:0;border-radius:24px 24px 0 0;box-shadow:0 -10px 40px rgba(25,24,45,.08)}
.nav-btn{border:0;background:transparent;color:#858793;padding:7px 3px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;font-weight:750}.nav-btn b{font-size:19px}.nav-btn.active{color:var(--accent)}
.pos-nav b{width:40px;height:40px;border-radius:14px;background:var(--accent);color:#fff;display:grid;place-items:center;margin-top:-22px;box-shadow:0 10px 24px rgba(109,93,252,.3)}
.overlay{position:fixed;inset:0;z-index:80;display:flex;align-items:flex-end;justify-content:center}.overlay-backdrop{position:absolute;inset:0;background:rgba(22,20,34,.48);backdrop-filter:blur(5px)}
.sheet{position:relative;width:min(100%,760px);max-height:92vh;overflow:auto;background:#fff;border-radius:28px 28px 0 0;padding:8px 18px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(20,18,35,.22);animation:sheetUp .24s ease-out}
@keyframes sheetUp{from{transform:translateY(30px);opacity:.3}}
.sheet-handle{width:46px;height:5px;border-radius:99px;background:#dadbe2;margin:5px auto 14px}.sheet-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px}.sheet-title h2{margin:0;font-size:22px}.sheet-close{border:0;background:#f3f3f7;width:38px;height:38px;border-radius:13px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:12px;color:var(--muted);font-weight:750}
.field input,.field textarea,.field select,.search{width:100%;border:1px solid var(--line);background:#f9f9fc;border-radius:15px;padding:13px 14px;outline:0;color:var(--text)}.field input:focus,.field textarea:focus,.field select:focus,.search:focus{border-color:#aaa0ff;box-shadow:0 0 0 3px #eeecff}
.field textarea{min-height:92px;resize:vertical}.form-actions{display:flex;gap:10px;margin-top:16px}.form-actions>*{flex:1}
.toolbar{display:flex;gap:9px;margin:0 0 14px}.toolbar .search{flex:1}.toolbar button{white-space:nowrap}
.badge{display:inline-flex!important;align-items:center;justify-content:center;width:max-content;border-radius:999px;padding:5px 9px;font-size:11px!important;font-weight:850}.badge.new{background:#eeecff;color:#5d4ff0}.badge.processing{background:#fff4dc;color:#a46b00}.badge.ready{background:#e8f8f1;color:#128359}.badge.delivered{background:#e6f7ef;color:#0f8055}.badge.cancelled{background:#fff0f1;color:#c93948}
.product-list{display:grid;grid-template-columns:repeat(2,1fr);gap:11px}
.product-card{border:1px solid var(--line);border-radius:18px;background:#fff;padding:10px;display:grid;grid-template-columns:76px 1fr;gap:11px;text-align:right}
.product-thumb{width:76px;height:76px;border-radius:14px;background:#f0f0f5;object-fit:cover;display:grid;place-items:center;font-size:25px}
.product-card h3{font-size:14px;margin:3px 0 5px}.product-card p{font-size:12px;color:var(--muted);margin:0 0 6px}
.price{font-weight:900;color:var(--accent)}.stock-low{color:var(--danger)!important;font-weight:800}
.row-actions{display:flex;gap:6px;margin-top:8px}.mini-btn{border:1px solid var(--line);background:#fff;border-radius:10px;padding:7px 9px;font-size:11px;font-weight:800}
.mini-btn.primary{border:0;color:#fff;background:var(--accent);box-shadow:none}
.pos-layout{display:grid;grid-template-columns:1.5fr .9fr;gap:14px}
.pos-products{display:grid;grid-template-columns:repeat(2,1fr);gap:9px;align-content:start}
.pos-product{border:1px solid var(--line);background:#fff;border-radius:16px;padding:12px;text-align:right}
.pos-product strong{display:block}.pos-product small{color:var(--muted)}.pos-product .price{display:block;margin-top:6px}
.cart-panel{background:#f7f7fb;border-radius:20px;padding:13px;position:sticky;top:0;height:max-content}
.cart-line{display:grid;grid-template-columns:1fr auto;gap:8px;padding:9px 0;border-bottom:1px solid #e5e6ee}
.qty-controls{display:flex;gap:5px;align-items:center}.qty-controls button{width:28px;height:28px;border:0;border-radius:9px;background:#fff}
.cart-total{display:flex;justify-content:space-between;font-size:18px;font-weight:900;padding:14px 0}
.menu-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.menu-item{border:1px solid var(--line);background:#fff;border-radius:18px;padding:18px;text-align:right;font-weight:850}
.menu-item span{display:block;color:var(--muted);font-size:12px;font-weight:500;margin-top:5px}
.auth-overlay{position:fixed;inset:0;z-index:100;background:linear-gradient(145deg,#f4f2ff,#fff);display:grid;place-items:center;padding:18px}
.auth-card{width:min(100%,430px);background:#fff;border-radius:28px;padding:26px;box-shadow:var(--shadow);text-align:center}
.auth-card .brand-mark{margin:auto;width:58px;height:58px;border-radius:20px}.auth-card h1{margin:12px 0 4px}
.auth-card>p{margin:0 0 18px;color:var(--muted)}
.auth-tabs{background:#f4f4f8;border-radius:14px;padding:4px;display:grid;grid-template-columns:1fr 1fr;margin-bottom:16px}
.auth-tabs button{border:0;background:transparent;border-radius:11px;padding:10px;font-weight:850;color:var(--muted)}
.auth-tabs button.active{background:#fff;color:var(--accent);box-shadow:0 4px 12px rgba(20,20,30,.06)}
.auth-form{display:flex;flex-direction:column;gap:10px;text-align:right}.auth-form input{border:1px solid var(--line);background:#fafafd;border-radius:14px;padding:13px}
.auth-form .primary{margin-top:4px}
.toast{position:fixed;z-index:140;left:50%;bottom:100px;transform:translate(-50%,20px);max-width:calc(100% - 30px);background:#22212b;color:#fff;padding:12px 16px;border-radius:14px;opacity:0;pointer-events:none;transition:.2s}
.toast.show{opacity:1;transform:translate(-50%,0)}
.store-shell{min-height:100vh;background:#f7f7fb;padding-bottom:90px}
.store-topbar{position:sticky;top:0;z-index:25;display:flex;justify-content:space-between;align-items:center;padding:14px 18px;background:rgba(255,255,255,.92);backdrop-filter:blur(18px);border-bottom:1px solid var(--line)}
.cart-btn{border:0;background:var(--accent);color:#fff;border-radius:14px;padding:10px 13px;font-weight:850}.cart-btn span{background:#fff;color:var(--accent);border-radius:99px;padding:2px 7px;margin-right:5px}
.store-content{width:min(100%,980px);margin:auto;padding:18px}
.store-hero{border-radius:28px;padding:28px;background:linear-gradient(135deg,#242333,#514e66);color:#fff;margin-bottom:18px}.store-hero h1{margin:5px 0;font-size:29px}.store-hero p{margin:0;color:#d5d4dc}
.store-products{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}
.store-product{background:#fff;border:0;border-radius:20px;padding:10px;text-align:right;box-shadow:0 7px 24px rgba(22,22,38,.05)}
.store-product img,.store-product .product-thumb{width:100%;height:150px;border-radius:15px;object-fit:cover}.store-product h3{margin:10px 2px 5px;font-size:15px}.store-product p{height:36px;overflow:hidden;color:var(--muted);font-size:12px;margin:0 2px 8px}
.store-product-footer{display:flex;justify-content:space-between;align-items:center}.add-cart{border:0;border-radius:11px;background:#f0eeff;color:var(--accent);width:36px;height:36px;font-weight:900}
.muted{color:var(--muted)}.divider{height:1px;background:var(--line);margin:14px 0}.switch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0}
.avatar{width:45px;height:45px;border-radius:14px;background:#efedff;color:var(--accent);display:grid;place-items:center;font-weight:900}
.kpi-note{background:#f5f4ff;border:1px solid #e5e1ff;border-radius:16px;padding:13px;color:#5146b8;font-size:13px;margin-bottom:12px}
@media(min-width:800px){
  .sheet{align-self:center;border-radius:28px;max-height:86vh;padding:10px 22px 24px}
  .overlay{align-items:center;padding:24px}
  .bottom-nav{bottom:16px;border-radius:24px;border-bottom:1px solid var(--line)}
}
@media(max-width:720px){
  .home{padding:14px}.hero-card{padding:20px;border-radius:24px}.hero-card h1{font-size:23px}
  .stats-grid{grid-template-columns:repeat(2,1fr)}.quick-grid{grid-template-columns:repeat(2,1fr)}
  .product-list{grid-template-columns:1fr}.pos-layout{grid-template-columns:1fr}.pos-products{grid-template-columns:repeat(2,1fr)}
  .cart-panel{position:static}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}
  .store-products{grid-template-columns:repeat(2,1fr)}.store-product img,.store-product .product-thumb{height:130px}
}
@media(max-width:380px){
  .hero-card{align-items:stretch;flex-direction:column}.primary.compact{width:100%}
  .store-products{grid-template-columns:1fr}.pos-products{grid-template-columns:1fr}
}
.old-price{display:block;color:#9a9ca6;text-decoration:line-through;font-size:12px;margin-top:2px}
.store-product{position:relative}
.sale-badge{position:absolute;top:18px;right:18px;z-index:2;background:#fff0f1;color:#c83b49;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:900}
.add-cart:disabled{opacity:.4;cursor:not-allowed}
.category-chips{display:flex;gap:8px;overflow:auto;padding:0 0 14px;scrollbar-width:none}
.category-chips::-webkit-scrollbar{display:none}
.chip{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:999px;padding:9px 14px;white-space:nowrap;font-weight:800}
.chip.active{background:var(--accent);border-color:var(--accent);color:#fff}
.store-policy{margin-top:22px;background:#fff;border-radius:22px;padding:18px;box-shadow:0 7px 24px rgba(22,22,38,.05)}
.store-policy h3{margin:0 0 8px}.store-policy p{white-space:pre-line;color:var(--muted);line-height:1.7;margin:0 0 12px}
.store-contact{display:inline-flex;text-decoration:none;background:#e9fbf2;color:#147b53;border-radius:12px;padding:9px 12px;font-weight:850;margin-left:8px}
.store-social{display:inline-flex;background:#f4f2ff;color:#5b4bd5;border-radius:12px;padding:9px 12px;font-weight:850}
.secondary.compact{padding:12px 14px}
.invoice{background:#fafafd;border:1px solid var(--line);border-radius:20px;padding:16px}
.invoice-line,.invoice-total,.invoice-meta{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:11px 0;border-bottom:1px solid var(--line)}
.invoice-line:last-of-type{border-bottom:0}.invoice-total{font-size:19px;font-weight:900}.invoice-meta{font-size:12px;color:var(--muted)}
.invoice .divider{margin:5px 0}
