*{box-sizing:border-box;margin:0;padding:0}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:14px;background:#f4f6f9;color:#1a1d23;overflow:hidden;height:100vh}
:root{--sb:260px;--sbc:60px}
.sb{width:var(--sb);background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column;height:100vh;position:fixed;left:0;top:0;z-index:100;transition:width .2s}
.sb.col{width:var(--sbc)}
.sbh{padding:.9rem .75rem;border-bottom:1px solid #f3f4f6;display:flex;align-items:center;gap:9px;height:58px}
.sbl{width:34px;height:34px;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:15px;flex-shrink:0}
.sbn{font-size:15px;font-weight:700;white-space:nowrap;transition:opacity .15s;overflow:hidden}
.sb.col .sbn{opacity:0;width:0}
.sb.col~.main .topbar{padding-left:2.5rem}
.sbt{margin-left:auto;width:26px;height:26px;border:none;background:transparent;cursor:pointer;border-radius:6px;color:#9ca3af;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sbt:hover{background:#f3f4f6;color:#374151}
.sbnav{flex:1;overflow-y:auto;overflow-x:hidden;padding:.375rem 0}
.sbsec{padding:.625rem .875rem .25rem;font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.08em;white-space:nowrap;transition:opacity .15s}
.sb.col .sbsec{opacity:0}
.ni{display:flex;align-items:center;gap:9px;padding:8px 10px;margin:1px 6px;border-radius:8px;cursor:pointer;color:#4b5563;font-size:13px;font-weight:500;transition:all .15s;white-space:nowrap;position:relative}
.ni:hover{background:#f3f4f6;color:#111827}
.ni.on{background:#eff6ff;color:#2563eb;font-weight:600}
.ni svg{flex-shrink:0;width:18px;height:18px}
.ni .nl{overflow:hidden;transition:opacity .15s;max-width:200px}
.sb.col .ni .nl{opacity:0;max-width:0}
.nb{margin-left:auto;padding:2px 7px;border-radius:10px;font-size:10px;font-weight:700;background:#dbeafe;color:#2563eb;white-space:nowrap}
.sb.col .nb{display:none}
.sb.col .ni:hover::after{content:attr(data-tip);position:absolute;left:calc(var(--sbc) + 4px);top:50%;transform:translateY(-50%);background:#1f2937;color:#fff;padding:5px 10px;border-radius:7px;font-size:12px;white-space:nowrap;pointer-events:none;z-index:300;box-shadow:0 4px 12px rgba(0,0,0,.2)}
.main{margin-left:var(--sb);height:100vh;display:flex;flex-direction:column;transition:margin-left .2s}
.sb.col~.main{margin-left:var(--sbc)}
.topbar{height:58px;background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;padding:0 1.25rem;gap:.75rem;flex-shrink:0}
.tbtitle{font-size:16px;font-weight:700;color:#111827}
.tbright{margin-left:auto;display:flex;align-items:center;gap:.5rem}
.tbtn{display:flex;align-items:center;gap:6px;padding:7px 13px;border:1px solid #e5e7eb;border-radius:8px;background:#fff;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;color:#374151;transition:all .15s}
.tbtn:hover{background:#f9fafb}
.tbtn.g{background:#059669;color:#fff;border-color:#059669}
.tbtn.g:hover{background:#047857}
.content{flex:1;overflow:hidden;width:100%;height:100%}
iframe{width:100%;height:100%;border:none;display:block}
.stub{display:flex;align-items:center;justify-content:center;height:100%;padding:2rem;text-align:center}
.stubw{max-width:480px}
.stubi{font-size:52px;margin-bottom:1.25rem}
.stubt{font-size:22px;font-weight:800;color:#111827;margin-bottom:.5rem}
.stubd{font-size:14px;color:#6b7280;line-height:1.7;margin-bottom:1.5rem}
.stubst{text-align:left;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.25rem 1.5rem;margin-bottom:1.5rem}
.stubst h4{font-size:10px;font-weight:700;color:#9ca3af;text-transform:uppercase;letter-spacing:.06em;margin-bottom:.75rem}
.stubl{display:flex;gap:.75rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:13px;color:#374151}
.stubl:last-child{border-bottom:none}
.stubln{width:22px;height:22px;border-radius:50%;background:#dbeafe;color:#2563eb;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px}
.stubtags{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:center}
.stubtag{padding:5px 12px;border-radius:20px;font-size:12px;font-weight:600;background:#dbeafe;color:#1d4ed8}
.stubtag.g{background:#f3f4f6;color:#6b7280}
.swrap{height:100%;overflow-y:auto;padding:1.5rem}
.sgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem;max-width:900px}
.scard{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:1.25rem}
.scardh{display:flex;align-items:center;gap:10px;margin-bottom:1rem}
.slabel{font-size:11px;font-weight:600;color:#6b7280;margin-bottom:4px;display:block}
.sinput{width:100%;padding:9px 12px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:13px;font-family:inherit;margin-bottom:.75rem;transition:border-color .15s}
.sinput:focus{outline:none;border-color:#2563eb}
.sbtn{padding:8px 16px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.sbtn:hover{background:#1d4ed8}
.swarn{background:#fffbeb;border:1px solid #fde68a;border-radius:8px;padding:.75rem 1rem;font-size:12px;color:#92400e;line-height:1.6;margin-top:.75rem}
.sstatus{font-size:12px;margin-top:.5rem;display:none;color:#16a34a}
/* Settings tabs */
.stabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin-bottom:1.5rem}
.stab{padding:10px 20px;font-size:13px;font-weight:600;color:#6b7280;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .15s;white-space:nowrap}
.stab:hover{color:#111827}
.stab.on{color:#2563eb;border-bottom-color:#2563eb}
.stpanel{display:none}
.stpanel.on{display:block}
/* Settings form elements */
.sf-row{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:.75rem}
.sf-row.w1{grid-template-columns:1fr}
.sf-select{width:100%;padding:9px 12px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:13px;font-family:inherit;background:#fff;transition:border-color .15s}
.sf-select:focus{outline:none;border-color:#2563eb}
.sf-hint{font-size:11px;color:#9ca3af;margin-top:2px}
.sf-saved{display:inline-block;font-size:12px;color:#16a34a;margin-left:8px;opacity:0;transition:opacity .3s}
.sf-saved.show{opacity:1}
/* Shop list */
.shop-row{display:flex;align-items:center;padding:14px 16px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff;gap:12px;transition:box-shadow .15s}
.shop-row:hover{box-shadow:0 2px 8px rgba(0,0,0,.06)}
.shop-mp{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:15px;flex-shrink:0}
.shop-mp.wb{background:#CB11AB18}
.shop-mp.oz{background:#0069FF18}
.shop-info{flex:1;min-width:0}
.shop-name{font-size:14px;font-weight:600;color:#111827}
.shop-sub{font-size:12px;color:#9ca3af;margin-top:2px}
.shop-date{font-size:12px;color:#9ca3af;white-space:nowrap;margin-right:12px}
.shop-badge{padding:4px 10px;border-radius:6px;font-size:11px;font-weight:600;white-space:nowrap;margin-right:8px}
.shop-badge.ok{background:#dcfce7;color:#16a34a}
.shop-badge.no{background:#fef2f2;color:#dc2626}
.shop-btn{padding:6px 14px;border:1px solid #e5e7eb;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;background:#fff;color:#374151;transition:all .15s;white-space:nowrap}
.shop-btn:hover{background:#f3f4f6}
.shop-btn.del{color:#dc2626;border-color:#fecaca}
.shop-btn.del:hover{background:#fef2f2}
/* Tax grid */
.tax-qcard{background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden}
.tax-qhead{display:grid;grid-template-columns:1fr 80px 80px;align-items:center;background:#f9fafb;border-bottom:1px solid #e5e7eb;padding:8px 14px;gap:8px}
.tax-qname{font-size:13px;font-weight:700;color:#111827}
.tax-qcol{font-size:11px;font-weight:700;color:#6b7280;text-align:center}
.tax-row{display:grid;grid-template-columns:1fr 80px 80px;align-items:center;padding:7px 14px;gap:8px;border-bottom:1px solid #f3f4f6}
.tax-row:last-child{border-bottom:none}
.tax-row.quarter-row{background:#f9fafb}
.tax-month{font-size:13px;color:#374151}
.tax-inp{width:100%;border:1.5px solid #e5e7eb;border-radius:6px;padding:5px 8px;font-size:13px;font-family:inherit;text-align:center;transition:border-color .15s}
.tax-inp:focus{outline:none;border-color:#2563eb}
/* Login screen */
.login-screen{position:fixed;inset:0;background:#f4f6f9;z-index:1000;display:flex;align-items:center;justify-content:center}
.login-box{background:#fff;border-radius:16px;padding:2.5rem;width:400px;max-width:92vw;box-shadow:0 8px 40px rgba(0,0,0,.1)}
.login-logo{width:48px;height:48px;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:22px;margin:0 auto 1.25rem}
.login-title{font-size:22px;font-weight:800;text-align:center;margin-bottom:.375rem}
.login-sub{font-size:13px;color:#6b7280;text-align:center;margin-bottom:1.75rem}
.login-err{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:.625rem 1rem;font-size:12px;color:#dc2626;margin-bottom:.75rem;display:none}
/* User list */
.user-row{display:flex;align-items:center;padding:12px 16px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:8px;background:#fff;gap:12px}
.user-ava{width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#7c3aed);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:14px;flex-shrink:0}
.user-info{flex:1;min-width:0}
.user-name{font-size:13px;font-weight:600;color:#111827}
.user-email{font-size:12px;color:#9ca3af;margin-top:1px}
.user-role{padding:3px 8px;border-radius:5px;font-size:11px;font-weight:600;background:#eff6ff;color:#2563eb;white-space:nowrap}
.user-role.admin{background:#fef3c7;color:#d97706}
/* Topbar user */
.tb-user{display:flex;align-items:center;gap:8px;padding:5px 10px;border-radius:8px;cursor:pointer;border:1px solid #e5e7eb;transition:background .15s}
.tb-user:hover{background:#f9fafb}
.tb-uava{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,#2563eb,#7c3aed);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:12px}
.tb-uname{font-size:12px;font-weight:600;color:#374151}
/* Modal */
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:500;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-bg.show{opacity:1;pointer-events:auto}
.modal{background:#fff;border-radius:14px;padding:1.75rem;width:440px;max-width:92vw;box-shadow:0 20px 60px rgba(0,0,0,.15)}
.modal h3{font-size:16px;font-weight:700;margin-bottom:1.25rem}
.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:1.25rem}
/* Goods table */
.g-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;flex-wrap:wrap;gap:8px}
.g-count{font-size:13px;color:#6b7280}
.g-table{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
.g-table th{text-align:left;padding:10px 12px;font-size:11px;font-weight:700;color:#6b7280;text-transform:uppercase;letter-spacing:.04em;border-bottom:2px solid #e5e7eb;white-space:nowrap}
.g-table td{padding:10px 12px;border-bottom:1px solid #f3f4f6;vertical-align:middle}
.g-table tr:hover td{background:#f9fafb}
.g-img{width:48px;height:48px;border-radius:8px;object-fit:cover;background:#f3f4f6;cursor:pointer}
.g-img-wrap{position:relative;display:inline-block}
.g-img-wrap:hover .g-img-pop{display:block}
.g-img-pop{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:300px;height:400px;object-fit:contain;background:#fff;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,.3);z-index:500;padding:8px}
.g-title{font-weight:600;color:#111827}
.g-vc{font-size:12px;color:#6b7280;margin-top:2px;word-break:break-all}
.g-cat{padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600;background:#f3f4f6;color:#374151;white-space:nowrap}
.g-dim{font-size:12px;color:#6b7280;white-space:nowrap}
.g-load{text-align:center;padding:3rem;color:#6b7280}
.g-load .spin{display:inline-block;width:24px;height:24px;border:3px solid #e5e7eb;border-top-color:#2563eb;border-radius:50%;animation:gspin .6s linear infinite;margin-bottom:8px}
@keyframes gspin{to{transform:rotate(360deg)}}
.g-sortable{cursor:pointer;user-select:none}
.g-sortable:hover{color:#2563eb}
.g-price{font-weight:600;white-space:nowrap}
.g-discount{font-weight:600;color:#dc2626}
.g-final{font-weight:700;color:#059669;white-space:nowrap}
.g-inway{font-size:12px;color:#6b7280;white-space:nowrap}
.g-stock-total{font-weight:700;color:#2563eb;font-size:14px}
.g-forecast-row td{background:#eff6ff !important;border-bottom:2px solid #bfdbfe !important}
.g-forecast-inp{width:100px;padding:5px 8px;border:1.5px solid #2563eb;border-radius:6px;font-size:13px;font-family:inherit;text-align:left;background:#fff}
.g-forecast-inp:focus{outline:none;border-color:#1d4ed8}
.g-fc-label{font-size:11px;color:#2563eb;font-weight:600}
.g-fc-diff{font-size:11px;font-weight:600;margin-top:2px}
.g-fc-diff.up{color:#059669}
.g-fc-diff.down{color:#dc2626}
.g-cost-wrap{display:flex;align-items:center;gap:4px;white-space:nowrap}
.g-cost-input{width:80px;padding:5px 8px;border:1.5px solid #e5e7eb;border-radius:6px;font-size:12px;font-family:inherit;text-align:right}
.g-cost-input:focus{outline:none;border-color:#2563eb}
.g-cost-val{font-weight:600;font-size:13px}
.g-cost-btn{padding:3px 8px;border:1px solid #e5e7eb;border-radius:5px;font-size:11px;font-weight:600;cursor:pointer;background:#fff;color:#374151;font-family:inherit}
.g-cost-btn:hover{background:#f3f4f6}
.g-cost-btn.save{background:#059669;color:#fff;border-color:#059669}
.g-cost-btn.save:hover{background:#047857}
.g-rating{display:flex;align-items:center;gap:4px;white-space:nowrap}
.g-star{color:#f59e0b;font-size:13px}
.g-rating-val{font-weight:700;font-size:13px}
