:root{--bg: #f5f7fb;--panel: #ffffff;--line: #e5e7eb;--text: #1f2937;--muted: #6b7280;--accent: #2563eb;--ok: #059669;--bad: #dc2626;--warn: #d97706;--side-w: 240px;--side-bg: #ffffff;--side-text: #4b5563}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#app{margin:0;height:100%}body{font-family:Segoe UI,PingFang SC,Noto Sans SC,sans-serif;background:var(--bg);color:var(--text)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit;color:inherit}h2,h3{margin:0 0 12px}button{background:var(--accent);color:#fff;border:0;border-radius:8px;padding:8px 14px;cursor:pointer;font-weight:600;white-space:nowrap;-webkit-tap-highlight-color:transparent;outline:none}button:focus,button:active{outline:none}button.ghost{background:#fff;color:var(--text);border:1px solid var(--line)}button.danger{background:var(--bad);color:#fff}button:disabled{opacity:.5;cursor:not-allowed}input,select{background:#fff;border:1px solid var(--line);border-radius:8px;padding:8px 10px;width:100%;min-width:0;color:var(--text)}.layout{display:flex;min-height:100%;min-height:100dvh;background:var(--bg)}.backdrop{display:none}.side{width:var(--side-w);flex-shrink:0;background:var(--side-bg);border-right:1px solid var(--line);padding:20px 14px;display:flex;flex-direction:column;min-height:100dvh;position:sticky;top:0}.brand{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px}.side h1{font-size:18px;margin:0;color:var(--text)}.close-btn{display:none}.menu{flex:1}.side a{display:block;padding:10px 12px;border-radius:8px;color:var(--side-text);margin-bottom:4px}.side a.router-link-active,.side a:hover{background:#eff6ff;color:var(--accent)}.user-menu{position:relative}.avatar{width:36px;height:36px;padding:0;border:0;border-radius:50%;background:#dbeafe;color:var(--accent);font-weight:700;display:inline-flex;align-items:center;justify-content:center;box-shadow:none}.avatar:focus,.avatar:active{background:#bfdbfe}.user-pop{position:absolute;top:calc(100% + 8px);right:0;width:220px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px #0f172a24;padding:12px;z-index:40}.user-pop-head{display:flex;align-items:center;gap:10px}.user-pop-name{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.user-pop-line{height:1px;background:var(--line);margin:12px 0}.user-pop button{width:100%;background:transparent;color:var(--text);border:0;border-radius:8px;padding:8px 10px;text-align:left;font-weight:600;box-shadow:none}.user-pop button:hover,.user-pop button:active{background:#f3f4f6}.user-pop-logout{text-align:center!important}.content{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg)}.mobile-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 24px;border-bottom:1px solid var(--line);background:#fff;position:sticky;top:0;z-index:10}.mobile-bar .hamburger{display:none}.mobile-bar strong{flex:1}.page-tabs{display:flex;align-items:center;gap:6px;padding:10px 24px 0;overflow-x:auto;flex-shrink:0;background:var(--bg)}.page-tab{display:inline-flex;align-items:center;gap:4px;padding:0 4px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--text);font-weight:600;font-size:13px;white-space:nowrap;box-shadow:0 1px 2px #0f172a0a}.page-tab-title{border:0;background:transparent;color:inherit;font:inherit;padding:7px 8px;cursor:pointer}.page-tab.active{background:#eff6ff;border-color:#bfdbfe;color:var(--accent)}.page-tab-x{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border:0;background:transparent;border-radius:6px;color:var(--muted);font-size:16px;line-height:1;font-weight:500;cursor:pointer;padding:0}.page-tab-x:hover{background:#fee2e2;color:var(--bad)}.main{flex:1;padding:24px;overflow:auto}.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:16px;box-shadow:0 1px 2px #0f172a0a}.row{display:flex;gap:12px;flex-wrap:wrap;align-items:end}.field{min-width:160px;flex:1}.field label{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}.table-wrap{width:100%;overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:640px}th,td{text-align:left;padding:10px 8px;border-bottom:1px solid var(--line);font-size:14px}th{color:var(--muted);font-weight:600}.nowrap-table th,.nowrap-table td{white-space:nowrap;word-break:keep-all}.parent-row.clickable{cursor:pointer}.parent-row.clickable:hover,.child-row{background:#f8fafc}.child-code{padding-left:28px!important}.tree-toggle{display:inline-block;width:16px;margin-right:6px;color:var(--muted);font-family:ui-monospace,monospace}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions.nowrap{flex-wrap:nowrap}.muted{color:var(--muted)}.ok{color:var(--ok)}.bad{color:var(--bad)}.link{color:var(--accent);font-size:13px}.banner{padding:16px;border-radius:12px;font-size:22px;font-weight:700;margin-bottom:12px;word-break:break-all}.banner.ok{background:#ecfdf5;color:var(--ok)}.banner.bad{background:#fef2f2;color:var(--bad)}.toast{position:fixed;top:16px;left:50%;z-index:80;transform:translate(-50%,-12px);max-width:calc(100% - 32px);padding:10px 16px;border-radius:10px;font-size:14px;font-weight:600;box-shadow:0 8px 24px #0f172a29;opacity:0;pointer-events:none;visibility:hidden;transition:opacity .2s ease,transform .2s ease,visibility .2s ease}.toast.show{opacity:1;visibility:visible;transform:translate(-50%)}.toast.ok{background:#059669;color:#fff}.toast.bad{background:#dc2626;color:#fff}.login{min-height:100%;min-height:100dvh;display:grid;place-items:center;padding:16px;background:var(--bg)}.login .login-box{width:min(400px,100%);box-shadow:0 24px 64px #0f172a1f}.tags{display:flex;flex-wrap:wrap;gap:8px}.tag{background:#f8fafc;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-family:ui-monospace,monospace;word-break:break-all}.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}#reader{width:100%;max-width:420px;margin:0 auto}.hidden-file{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.scan-stage{width:100%;max-width:none;margin:0;min-height:280px;border-radius:12px;overflow:hidden;background:#0f172a}.scan-stage video,.scan-stage canvas{width:100%!important;max-width:none!important;object-fit:cover}.cart-total{margin-top:12px;text-align:right;font-size:18px;font-weight:700}.icon-btn{padding:8px 12px}.hamburger{width:40px;height:40px;padding:0;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:transparent;color:var(--text);border:0;border-radius:8px;box-shadow:none}.hamburger span{display:block;width:18px;height:2px;background:currentColor;border-radius:2px}.hamburger:focus,.hamburger:active{background:transparent}.modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a6b;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);display:grid;place-items:center;z-index:50;padding:16px}.modal{width:min(460px,100%);background:#fff;border:1px solid #eef2f7;border-radius:16px;padding:0;box-shadow:0 24px 64px #0f172a2e;overflow:hidden}.modal.sm{width:min(400px,100%)}.modal.lg{width:min(760px,100%)}.barcode-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;max-height:56vh;overflow:auto;padding:2px}.barcode-card{border:1px solid var(--line);border-radius:12px;padding:10px 12px 12px;background:#f8fafc;text-align:center}.barcode-card svg{width:100%;height:56px}.barcode-meta{display:flex;justify-content:space-between;gap:8px;font-size:12px;margin-bottom:6px}.barcode-code{font-family:ui-monospace,monospace;font-size:12px;margin-top:4px;word-break:break-all}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:20px 20px 0}.modal-head h3{margin:0;font-size:18px;line-height:1.3}.modal-desc{margin:6px 0 0;color:var(--muted);font-size:13px;line-height:1.5}.modal-x{width:32px;height:32px;padding:0;border-radius:8px;background:#f3f4f6;color:#6b7280;font-size:20px;line-height:1;font-weight:500;flex-shrink:0}.modal-x:hover{background:#e5e7eb;color:#111827}.modal-body{padding:16px 20px 8px;display:grid;gap:12px}.modal-body .field{min-width:0}.modal-body .field label{font-size:13px;color:#374151;font-weight:600;margin-bottom:6px}.modal-body input,.modal-body select{padding:10px 12px;border-radius:10px;border-color:#dbe1ea;background:#f8fafc}.modal-body input:focus,.modal-body select:focus{outline:2px solid #bfdbfe;border-color:var(--accent);background:#fff}.modal-alert{padding:12px 14px;border-radius:10px;background:#f8fafc;color:#374151;line-height:1.6}.modal-alert.warn{background:#fff7ed;color:#9a3412}.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 20px}.modal-enter-active,.modal-leave-active{transition:opacity .18s ease}.modal-enter-active .modal,.modal-leave-active .modal{transition:transform .18s ease,opacity .18s ease}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal,.modal-leave-to .modal{transform:translateY(8px) scale(.98);opacity:0}.stat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:16px}.stat-grid.product-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-row{display:grid;grid-template-columns:minmax(160px,.38fr) minmax(240px,1fr);gap:12px;align-items:end}.filter-row .field{min-width:0}.search-combo{display:flex;gap:8px;align-items:stretch}.search-combo input{flex:1}.row.date-filter{flex-wrap:nowrap}.date-range{flex:1.4;min-width:0}.date-range-ctrls{display:flex;align-items:center;gap:8px;min-width:0}.date-range-ctrls input{flex:1;min-width:0}.date-range-ctrls span{color:var(--muted);flex-shrink:0;font-weight:600}.stat-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px;box-shadow:0 1px 2px #0f172a0a}.stat-label{color:var(--muted);font-size:13px;margin-bottom:8px}.stat-value{font-size:28px;font-weight:700;line-height:1.1}.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.dash-grid .card{margin-bottom:0}.dash-grid table{min-width:max-content;width:100%}.dash-grid th,.dash-grid td{white-space:nowrap;word-break:keep-all}.main:has(.home-page){overflow:auto;display:flex;flex-direction:column}.home-page.dash{flex:1;min-width:0;display:flex;flex-direction:column;gap:16px;max-width:1080px}.dash-hero h2{margin:0;font-size:28px;letter-spacing:-.03em}.dash-hero p{margin:4px 0 0;color:var(--muted);font-size:14px}.kpi-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.kpi-card{border-radius:22px;padding:16px 16px 14px;min-height:128px;display:flex;flex-direction:column;box-shadow:none;border:0}.kpi-stock{background:#eaf8ea;color:#1f7a3a}.kpi-in{background:#e7f7ee;color:#1f8a55}.kpi-out{background:#fdecd8;color:#c05621}.kpi-alert{background:#fde8e8;color:#c53030}.kpi-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.kpi-icon{width:36px;height:36px;border-radius:12px;background:#ffffff8c;display:inline-flex;align-items:center;justify-content:center}.kpi-icon svg{width:18px;height:18px}.kpi-delta{font-size:12px;font-weight:700}.kpi-delta.up{color:#16a34a}.kpi-delta.down{color:#dc2626}.kpi-value{font-size:32px;font-weight:800;line-height:1;color:#111827;letter-spacing:-.04em}.kpi-unit{margin-left:4px;font-size:14px;font-weight:700;color:#6b7280;letter-spacing:0}.kpi-label{margin-top:8px;font-size:13px;color:#6b7280;font-weight:600}.dash-body{display:grid;grid-template-columns:1.15fr .85fr;gap:16px;align-items:start}.dash-side{display:grid;gap:16px}.dash-card{background:#fff;border-radius:24px;padding:18px 18px 16px;box-shadow:0 10px 30px #0f172a0d}.dash-card h3{margin:0;font-size:18px}.dash-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:14px}.dash-empty{margin:8px 0 4px}.chart-card .dash-card-head{margin-bottom:12px}.range-tabs{display:flex;gap:4px;background:#f3f4f6;border-radius:999px;padding:3px}.range-tab{background:transparent;color:#6b7280;border:0;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700;box-shadow:none}.range-tab.active{background:#fff;color:#111827;box-shadow:0 1px 3px #0f172a14}.chart{display:grid;grid-template-columns:52px 1fr;gap:8px;min-height:220px}.chart-y{display:flex;flex-direction:column;justify-content:space-between;color:#9ca3af;font-size:11px;text-align:right;padding:22px 0}.chart-scroll{min-width:0;overflow:hidden}.chart-scroll.swipe{overflow-x:auto;-webkit-overflow-scrolling:touch}.chart-plot{position:relative;height:100%;min-height:220px;min-width:0}.chart-grid{position:absolute;top:22px;right:0;bottom:22px;left:0;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}.chart-grid i{display:block;height:1px;background:#eef2f6}.chart-bars{position:absolute;top:4px;right:0;bottom:0;left:0;display:flex;align-items:stretch;gap:6px}.chart-col{flex:1 0 0;display:flex;flex-direction:column;align-items:center;min-width:0}.chart-scroll.swipe .chart-col{flex:0 0 38px}.chart-bar-wrap{flex:1;width:100%;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.chart-val{font-size:11px;font-weight:700;color:#374151;line-height:1.1;margin-bottom:4px;white-space:nowrap}.chart-bar{width:58%;max-width:28px;min-height:8px;border-radius:8px 8px 4px 4px;background:#b7d9a8}.chart-col span{height:22px;line-height:22px;font-size:11px;color:#9ca3af;white-space:nowrap}.alert-pill{background:#fde8e8;color:#e11d48;border-radius:999px;font-size:12px;font-weight:700;padding:4px 10px}.alert-list,.act-list{display:grid;gap:10px}.alert-item,.act-item{background:#f8fafc;border-radius:16px;padding:12px 14px}.alert-row,.act-item{display:flex;align-items:center;gap:10px}.alert-row>div:first-child,.act-text{flex:1;min-width:0}.alert-item strong,.act-text strong{display:block;font-size:14px}.alert-item p,.act-text p{margin:3px 0 0;color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.alert-qty,.act-meta{text-align:right;flex-shrink:0}.alert-qty b{display:block;color:#ef4444;font-size:18px;line-height:1}.alert-qty span,.act-meta span{color:var(--muted);font-size:12px}.alert-bar{height:6px;background:#e5e7eb;border-radius:99px;overflow:hidden;margin-top:10px}.alert-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#ef4444,#f59e0b)}.act-icon{width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.act-icon svg{width:18px;height:18px}.act-icon.inbound{background:#e7f7ee;color:#16a34a}.act-icon.outbound{background:#fdecd8;color:#ea580c}.act-meta b{display:block;font-size:16px;line-height:1.1}@media(max-width:1100px){.stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.stat-grid.product-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-grid,.dash-body{grid-template-columns:1fr}}@media(max-width:960px){.backdrop{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a66;z-index:20;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .28s ease,visibility .28s ease}.layout.open .backdrop,.backdrop.show{opacity:1;visibility:visible;pointer-events:auto}.side{position:fixed;left:0;top:0;bottom:0;z-index:30;transform:translate3d(-100%,0,0);transition:transform .28s cubic-bezier(.32,.72,0,1);min-height:100dvh;box-shadow:8px 0 24px #0f172a1f;will-change:transform;backface-visibility:hidden}.layout.open .side{transform:translateZ(0)}.close-btn{display:inline-flex}.mobile-bar{padding:10px 12px}.mobile-bar .hamburger{display:inline-flex;margin-left:-4px}.mobile-bar strong{text-align:center}.page-tabs{padding:10px 14px 0}.main{padding:14px}.field{min-width:100%}.row.date-filter{flex-wrap:wrap}.date-range{min-width:100%}.date-range-ctrls{flex-wrap:nowrap}.filter-row{grid-template-columns:minmax(140px,.38fr) minmax(180px,1fr)}.filter-row .field{min-width:0}.banner{font-size:16px}}@media(max-width:600px){.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-value{font-size:22px}table{min-width:520px}th,td{font-size:13px;padding:8px 6px}.card{padding:14px}}@page{margin:8mm}@media print{.no-print{display:none!important}body{background:#fff;color:#000}.layout,.content,.main{display:block}.labels{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.label{border:1px solid #000;padding:8px;break-inside:avoid}}
