:root{--bg: #f4f6f9;--card: #fff;--text: #1d2530;--muted: #5d6b7a;--line: #dfe4ea;--primary: #1f4e79;--primary-2: #163a5a;--ok: #1e7b45;--warn: #a76100;--bad: #b3261e;--radius: 10px;font-size:17px}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;line-height:1.45}h1{font-size:1.5rem;margin:.2rem 0 .8rem}h2{font-size:1.2rem;margin:1.2rem 0 .6rem}h3{font-size:1.02rem;margin:.8rem 0 .3rem}a{color:var(--primary)}code{background:#eef1f5;padding:1px 5px;border-radius:4px}input,select,textarea,button{font:inherit;color:inherit}input,select,textarea{width:100%;padding:.6rem .7rem;border:1px solid #b9c3ce;border-radius:8px;background:#fff;min-height:46px}input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible{outline:3px solid #7fb0e0;outline-offset:1px}input[type=checkbox]{width:22px;height:22px;min-height:0;accent-color:var(--primary)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;padding:.55rem 1rem;min-height:46px;border:1px solid #b9c3ce;border-radius:8px;background:#fff;cursor:pointer;text-decoration:none;color:var(--text);font-weight:600;white-space:nowrap}.btn:hover{background:#eef2f6}.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn.primary:hover{background:var(--primary-2)}.btn.danger{color:var(--bad);border-color:#e2aaa6}.btn.danger:hover{background:#fbeceb}.btn.small{min-height:38px;padding:.3rem .7rem;font-size:.9rem}.btn.big{width:100%;min-height:54px;font-size:1.1rem;margin-top:.6rem}.btn:disabled{opacity:.5;cursor:not-allowed}.link{background:none;border:none;color:var(--primary);cursor:pointer;padding:.3rem .4rem;text-decoration:underline}.link.danger{color:var(--bad)}.icon-btn{background:none;border:none;font-size:1.2rem;cursor:pointer;padding:.4rem;min-width:44px;min-height:44px}.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1rem;padding:.55rem 1rem;background:var(--primary);color:#fff}.brand{font-weight:700;font-size:1.1rem}.who{margin-left:auto;font-size:.85rem;opacity:.9}.menu-btn{display:none;color:var(--text)}.layout{display:flex;min-height:calc(100vh - 56px)}.sidebar{width:245px;flex-shrink:0;background:#fff;border-right:1px solid var(--line);padding:.8rem .5rem;display:flex;flex-direction:column;gap:2px}.sidebar a,.sidebar .logout{display:block;padding:.6rem .8rem;border-radius:8px;color:var(--text);text-decoration:none;background:none;border:none;text-align:left;cursor:pointer;width:100%}.sidebar a:hover,.sidebar .logout:hover{background:#eef2f6}.sidebar a.active{background:#e3edf7;color:var(--primary);font-weight:700}.sidebar .logout{margin-top:auto;color:var(--muted)}.nav-sep{font-size:.75rem;text-transform:uppercase;color:var(--muted);padding:.9rem .8rem .3rem;letter-spacing:.05em}main{flex:1;min-width:0}.page{max-width:1100px;margin:0 auto;padding:1rem 1rem 6rem}.page-head{display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap}.bottombar{display:none}.offline{background:#fff3cd;color:#6b4e00;padding:.5rem 1rem;text-align:center;font-weight:600}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1rem;margin-bottom:1rem}.card.narrow{max-width:420px;width:100%}.center-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1rem}.field{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.8rem;font-weight:600;font-size:.95rem}fieldset.field{border:1px solid var(--line);border-radius:8px;padding:.5rem .8rem;font-weight:400}.check{display:inline-flex;align-items:center;gap:.45rem;padding:.3rem .2rem;cursor:pointer;font-weight:400;margin-right:.7rem}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 1rem}.form-grid .wide{grid-column:1 / -1}.row-gap{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.row-gap input{flex:1;min-width:180px}.actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.6rem 0}.actions.center{justify-content:center}td.actions{margin:0}.muted{color:var(--muted)}.small{font-size:.85rem}.pre{white-space:pre-wrap}.neg{color:var(--bad)}.pos{color:var(--ok)}.search{font-size:1.05rem;margin-bottom:.6rem;min-height:52px}.filters{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:.5rem}.filters select,.filters input[type=date],.filters input[type=search]{width:auto;min-width:150px;flex:1 1 150px}.filters label{display:flex;align-items:center;gap:.3rem}.last-update{font-size:.8rem;color:var(--muted);margin:.2rem 0 .5rem}.last-update:first-letter{color:var(--ok)}.product-list,.simple-list,.lines,.serials,.bars{list-style:none;padding:0;margin:0}.product-row{display:flex;gap:.8rem;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:.7rem;margin-bottom:.5rem;cursor:pointer}.product-row.static{cursor:default}.product-row:hover:not(.static){border-color:#9fb6cd}.grow{flex:1;min-width:0}.title{font-weight:700}.right{text-align:right;flex-shrink:0}.price{font-weight:700;font-size:1.05rem}.qty{font-weight:700;font-size:.9rem}.qty.okq{color:var(--ok)}.qty.low{color:var(--warn)}.qty.out{color:var(--bad)}.chips{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.3rem}.chip{background:#eef2f6;border-radius:20px;padding:.1rem .55rem;font-size:.8rem}.chip.hl{background:#d7e7f6;font-weight:700}.thumb{border-radius:8px;object-fit:cover;background:#eef2f6;flex-shrink:0}.thumb.ph{display:flex;align-items:center;justify-content:center;font-size:1.5rem}.badge{display:inline-block;font-size:.75rem;font-weight:700;border-radius:20px;padding:.1rem .55rem;background:#eef2f6;vertical-align:middle}.badge.ok{background:#dcf2e4;color:var(--ok)}.badge.bad{background:#f9dedc;color:var(--bad)}.badge.warn{background:#fdecc8;color:var(--warn)}.badge.grey{background:#e6e9ed;color:var(--muted)}.add-locs{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}.simple-list li{margin-bottom:.45rem}.client-row,.sale-row{display:flex;gap:.6rem;align-items:center;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:.7rem;flex-wrap:wrap;text-decoration:none;color:inherit}.sale-row:hover{border-color:#9fb6cd}.client-row input{flex:1;min-width:140px}.pick{display:flex;flex-direction:column;align-items:flex-start;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:.7rem;cursor:pointer;min-height:52px}.pick.sel{border:2px solid var(--primary);background:#eef5fc}.table-wrap{overflow-x:auto;background:#fff;border:1px solid var(--line);border-radius:var(--radius);margin-bottom:1rem}table{width:100%;border-collapse:collapse;font-size:.93rem}th,td{padding:.55rem .6rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{background:#f7f9fb;font-size:.82rem;color:var(--muted);white-space:nowrap}td.num,th.num{text-align:right;white-space:nowrap}tr.row-error td{background:#fdf0ef}.preview{max-height:420px;overflow:auto}.kv{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:0}.kv dt{color:var(--muted)}.kv dd{margin:0}.detail-grid{display:grid;grid-template-columns:340px 1fr;gap:1rem;align-items:start}.gallery img{width:100%;border-radius:var(--radius);background:#fff;border:1px solid var(--line);aspect-ratio:4/3;object-fit:contain}.gallery .thumbs{display:flex;gap:.4rem;margin-top:.4rem}.gallery .thumbs button{padding:0;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer;width:64px}.gallery .thumbs button.sel{border-color:var(--primary)}.gallery .thumbs img{aspect-ratio:1;object-fit:cover}.empty-photo{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;background:#eef2f6;border-radius:var(--radius);color:var(--muted)}.photo-edit{display:flex;flex-wrap:wrap;gap:.6rem;margin-bottom:.6rem}.photo-edit div{display:flex;flex-direction:column;gap:.3rem;width:140px}.photo-edit img{width:140px;height:105px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}.serials li{padding:.35rem 0;border-bottom:1px solid var(--line)}.alert{border-radius:8px;padding:.65rem .8rem;margin:.6rem 0;display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}.alert.error{background:#fbeceb;color:#7d1a14;border:1px solid #efc2be}.alert.ok{background:#e6f4ec;color:#14532d;border:1px solid #bfe3cc}.alert.warn{background:#fff4dc;color:#6b4e00;border:1px solid #f0d797}.loading{display:flex;gap:.6rem;align-items:center;justify-content:center;padding:2rem;color:var(--muted)}.spinner{width:22px;height:22px;border:3px solid #cfd8e2;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.empty{text-align:center;padding:2rem 1rem;color:var(--muted);background:#fff;border:1px dashed #c8d0d9;border-radius:var(--radius)}.toast{position:fixed;left:50%;bottom:90px;transform:translate(-50%);background:#1d2530;color:#fff;padding:.7rem 1.1rem;border-radius:10px;z-index:100;box-shadow:0 6px 20px #00000040;max-width:92vw;cursor:pointer}.toast.bad{background:var(--bad)}.modal-bg{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f192380;z-index:50;display:flex;align-items:center;justify-content:center;padding:1rem}.modal{background:#fff;border-radius:12px;width:100%;max-width:560px;max-height:92vh;display:flex;flex-direction:column}.modal-head{display:flex;justify-content:space-between;align-items:center;padding:.6rem 1rem;border-bottom:1px solid var(--line)}.modal-head h2{margin:0}.modal-body{padding:1rem;overflow-y:auto}.modal-foot{display:flex;justify-content:flex-end;gap:.5rem;padding:.7rem 1rem;border-top:1px solid var(--line)}.stepper{display:flex;list-style:none;padding:0;margin:0 0 .8rem;gap:.3rem}.stepper li{flex:1}.stepper button{width:100%;padding:.5rem .2rem;border:none;border-bottom:4px solid var(--line);background:none;font-weight:600;color:var(--muted);cursor:pointer;font-size:.9rem}.stepper li.cur button{border-color:var(--primary);color:var(--primary)}.stepper li.done button{border-color:#8db4d9;color:var(--text)}.stepper button:disabled{cursor:default}.sticky-foot{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:.6rem 1rem;display:flex;gap:.6rem;align-items:center;margin:1rem -1rem 0;z-index:5}.sticky-foot .sum{margin-right:auto}.line{padding:.8rem}.line-head{display:flex;align-items:center;gap:.5rem}.line-head .icon-btn{margin-left:auto}.line-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:0 .8rem;margin-top:.4rem}.stepper-input{display:flex}.stepper-input button{width:46px;border:1px solid #b9c3ce;background:#f1f4f7;font-size:1.3rem;cursor:pointer}.stepper-input button:first-child{border-radius:8px 0 0 8px}.stepper-input button:last-child{border-radius:0 8px 8px 0}.stepper-input input{border-radius:0;text-align:center;border-left:none;border-right:none}.totals{display:grid;grid-template-columns:1fr auto;gap:.2rem 1rem;max-width:340px;margin:.5rem 0 1rem auto}.totals dd{margin:0;text-align:right}.confirm{font-size:1.2rem}.success{text-align:center;padding:2rem 1rem}.big-check{font-size:3rem}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin-bottom:1rem}.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:.9rem}.stat .label{color:var(--muted);font-size:.85rem}.stat .value{font-size:1.45rem;font-weight:700}.two-cols{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.bars li{margin-bottom:.7rem}.bar-label{display:flex;justify-content:space-between;gap:.5rem;font-size:.9rem;flex-wrap:wrap}.bar{height:12px;background:#eef2f6;border-radius:6px;overflow:hidden}.bar div{height:100%;background:var(--primary)}@media (max-width: 820px){:root{font-size:16px}.who{display:none}.menu-btn{display:inline-flex;margin-left:auto}.sidebar{position:fixed;top:0;bottom:0;left:0;z-index:40;transform:translate(-100%);transition:transform .2s;width:270px;overflow-y:auto}.sidebar.open{transform:none;box-shadow:0 0 30px #0000004d}.sidebar-bg{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:30}.page{padding:.8rem .7rem 6.5rem}.bottombar{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:25;background:#fff;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.bottombar a{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;padding:.4rem 0 .45rem;font-size:.75rem;color:var(--muted);text-decoration:none}.bottombar a span{font-size:1.35rem}.bottombar a.active{color:var(--primary);font-weight:700}.sticky-foot{bottom:58px;margin:1rem -.7rem 0;flex-wrap:wrap}.sticky-foot .sum{width:100%}.sticky-foot .btn{flex:1}.form-grid,.detail-grid,.two-cols{grid-template-columns:1fr}.line-grid,.stats{grid-template-columns:1fr 1fr}.stepper button{font-size:.78rem}.filters select,.filters input[type=date],.filters input[type=search]{min-width:0;flex:1 1 45%}.modal-bg{align-items:flex-end;padding:0}.modal{border-radius:14px 14px 0 0;max-height:94vh}.toast{bottom:80px}.kv{grid-template-columns:1fr;gap:0}.kv dt{margin-top:.4rem;font-size:.85rem}}@media (max-width: 820px){.empty-photo{aspect-ratio:auto;height:70px}}
