:root{--bg:#f1f5f9;--card:#fff;--text:#0f172a;--muted:#64748b;--line:#e2e8f0;--brand:#0f766e;--brand-ink:#fff;--danger:#b91c1c;--ok:#15803d;--radius:12px;color:var(--text);background:var(--bg);font-family:Segoe UI,Noto Sans SC,system-ui,sans-serif}*{box-sizing:border-box}html,body,#root{min-height:100%;margin:0}button,input,select,textarea{font:inherit}a{color:var(--brand)}.layout{grid-template-columns:220px 1fr;min-height:100vh;display:grid}.side{color:#e2e8f0;background:#0f172a;flex-direction:column;gap:.25rem;padding:1.1rem .8rem 5rem;display:flex}.side h1{color:#fff;margin:0 .4rem .8rem;font-size:1.05rem}.side a,.botnav a{color:inherit;border-radius:10px;padding:.7rem .85rem;text-decoration:none;display:block}.side a.active,.botnav a.active{background:var(--brand);color:#fff}.main{max-width:1100px;padding:1.1rem 1.2rem 5.5rem}:is(.main:has(.invoice-page),.main:has(.coa-page)){max-width:none;padding-right:1.5rem}.topbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:.85rem;padding-bottom:.65rem;display:flex}.topbar-left{flex-wrap:wrap;align-items:center;gap:.75rem;min-width:0;display:flex}.topbar button{flex-shrink:0;min-height:40px}.botnav{color:#e2e8f0;z-index:20;padding-bottom:env(safe-area-inset-bottom);background:#0f172a;grid-template-columns:repeat(10,minmax(3.4rem,1fr));display:none;position:fixed;bottom:0;left:0;right:0;overflow-x:auto}.botnav a{text-align:center;padding:.55rem .1rem;font-size:.68rem}.exp-switch{flex-wrap:wrap;gap:.5rem;margin-bottom:.75rem;display:flex}.exp-switch.sub{margin-top:-.2rem}.exp-switch a,.exp-switch button{min-width:7.5rem}.exp-switch a{color:#0f172a;background:#e2e8f0}.exp-switch a.active,.exp-switch button.active{background:var(--brand);color:#fff}.exp-head{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:.75rem;display:flex}.exp-block>h3,.exp-head h3{margin:0 0 .35rem;font-size:1.05rem}.exp-progress{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.exp-materials{margin:.35rem 0 0;padding-left:1.2rem}.exp-materials li{margin:.28rem 0}label.exp-step{border-top:1px solid var(--line);min-width:0;color:var(--text);flex:none;grid-template-columns:1.25rem 1fr;align-items:flex-start;gap:.65rem;padding:.7rem 0;font-size:.95rem;display:grid}label.exp-step input{width:1.15rem;height:1.15rem;min-height:0;margin-top:.15rem}label.exp-step strong{margin-bottom:.2rem;display:block}label.exp-step p{margin:0}label.exp-step.done strong{color:var(--ok)}.trouble-head{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:.75rem;display:flex}.blot-fig{flex:none;width:168px;margin:0}.blot-fig svg{width:100%;height:auto;display:block}.blot-fig figcaption{color:var(--muted);text-align:right;margin-top:.15rem;font-size:.75rem}.trouble-gallery{flex-wrap:wrap;align-items:flex-start;gap:.6rem;margin-top:.6rem;display:flex}.trouble-shot{width:140px;margin:0}.trouble-shot img{object-fit:cover;border:1px solid var(--line);background:#fff;border-radius:8px;width:140px;height:100px;display:block}button.trouble-shot-open{background:0 0;border:0;border-radius:8px;min-height:0;padding:0;display:block}.trouble-shot figcaption{color:var(--text);white-space:normal;-webkit-line-clamp:3;-webkit-box-orient:vertical;margin-top:.2rem;font-size:.78rem;display:-webkit-box;overflow:hidden}.trouble-shot button.secondary{min-height:32px;margin-top:.25rem;padding:.2rem .55rem}.trouble-note{flex:100%;align-items:flex-start;gap:.75rem;padding-top:.35rem;display:flex}.trouble-note>img{object-fit:contain;border:1px solid var(--line);background:#fff;border-radius:8px;width:160px;height:auto;max-height:140px}.trouble-note>div{flex:1;min-width:0}.trouble-note label{min-width:0}.trouble-note .row-actions{flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:.45rem;display:flex}label.trouble-upload{border:1px dashed var(--line);width:120px;min-height:90px;color:var(--muted);text-align:center;cursor:pointer;border-radius:8px;justify-content:center;align-items:center;padding:.4rem;font-size:.85rem;display:inline-flex}label.trouble-upload input{display:none}.trouble-paste{border:1px dashed var(--brand);width:120px;min-height:90px;color:var(--brand);text-align:center;cursor:pointer;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:.15rem;padding:.4rem;font-size:.85rem;display:inline-flex}.trouble-paste span{color:var(--muted);font-size:.75rem}.trouble-paste:focus{outline:2px solid var(--brand);outline-offset:2px}.trouble-item{border-top:1px solid var(--line);padding:.7rem 0}.trouble-item strong{margin-bottom:.25rem;display:block}.trouble-item p{margin:0}.ref-table{min-width:760px;font-size:.86rem}.ref-table th,.ref-table td{white-space:normal}.ref-table a{word-break:break-all}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);margin-bottom:.9rem;padding:1rem}h2{margin:0 0 .8rem;font-size:1.25rem}.row{flex-wrap:wrap;align-items:flex-end;gap:.55rem;margin-bottom:.65rem;display:flex}.row label.grow{flex:12rem;min-width:10rem}.line-edit label input,.line-edit label select{min-width:5.5rem}label{color:var(--muted);flex-direction:column;flex:1;gap:.25rem;min-width:140px;font-size:.85rem;display:flex}.checks{flex-wrap:wrap;gap:.55rem 1rem;margin:.45rem 0 .7rem;display:flex}.row-actions{flex-wrap:wrap;gap:.4rem;display:flex}.checks label{min-width:0;color:var(--text);flex-direction:row;flex:none;align-items:center;gap:.35rem}input,select,textarea{border:1px solid var(--line);min-height:44px;color:inherit;background:#fff;border-radius:10px;padding:.45rem .65rem}textarea{min-height:80px}button,.btn{background:var(--brand);min-height:44px;color:var(--brand-ink);cursor:pointer;border:0;border-radius:10px;justify-content:center;align-items:center;padding:.45rem .9rem;text-decoration:none;display:inline-flex}button.secondary,.btn.secondary{color:#0f172a;background:#e2e8f0}button.danger{background:var(--danger)}button:disabled{opacity:.5}table{border-collapse:collapse;width:100%;font-size:.92rem}.table-wrap{-webkit-overflow-scrolling:touch;overflow-x:auto}.summary-table th,.summary-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:top;padding:.55rem .45rem}.summary-table th{color:var(--muted);white-space:nowrap;font-size:.8rem;font-weight:600}.summary-table td{font-size:.9rem}.summary-search{color:var(--muted);margin:.65rem 0 .75rem;font-size:.85rem;display:block}.summary-search input{width:100%;max-width:28rem;margin-top:.35rem;display:block}.filter-block{margin:.15rem 0 .55rem}.filter-block p{margin:0 0 .3rem;font-size:.85rem}.tag-picks{flex-wrap:wrap;gap:.4rem;display:flex}.tag-picks button{color:#0f172a;background:#e2e8f0;min-height:36px}.tag-picks button.active{background:var(--brand);color:#fff}.invoice-head{justify-content:space-between;align-items:baseline;gap:1rem;margin-bottom:.35rem;display:flex}.invoice-head h2{margin:0}.invoice-note{max-width:72rem;margin:0 0 .9rem}.invoice-section-head{justify-content:space-between;align-items:baseline;gap:.75rem;margin-bottom:.75rem;display:flex}.invoice-section-head h3{margin:0}.invoice-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.15rem 0 .85rem;display:grid}.invoice-metrics div{border:1px solid var(--line);background:#f8fafc;border-radius:10px;padding:.7rem .9rem}.invoice-metrics span{color:var(--muted);font-size:.78rem;display:block}.invoice-metrics strong{font-variant-numeric:tabular-nums;margin-top:.15rem;font-size:1.15rem;display:block}.invoice-metrics .total{background:#f0fdfa;border-color:#99f6e4}.invoice-table th.num,.invoice-table td.num{text-align:right;font-variant-numeric:tabular-nums}.pager{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.75rem;margin-top:.75rem;display:flex}.pager-pages{flex-wrap:wrap;align-items:center;gap:.35rem;display:flex}.pager-pages button{color:#0f172a;background:#e2e8f0;min-width:2.4rem;min-height:36px;padding:.2rem .55rem}.pager-pages button.active{background:var(--brand);color:#fff}@media (width>=861px){.invoice-table td{white-space:nowrap}.invoice-table td:nth-child(5),.invoice-table td:nth-child(6){white-space:normal;min-width:12rem}}.pdf-link{line-height:0;display:inline-flex}.pdf-link svg{width:28px;height:32px}.file-list{margin:.35rem 0 0;padding:0;list-style:none}.file-list li{flex-wrap:wrap;align-items:center;gap:.45rem;margin:.25rem 0;display:flex}.proof-hits{border:1px solid var(--line);background:#f8fafc;border-radius:10px;margin:0 0 .85rem;padding:.65rem .75rem}.proof-hits-title{color:var(--muted);margin-bottom:.5rem;font-size:.85rem;font-weight:600}.proof-hits-list{flex-wrap:wrap;gap:.65rem;display:flex}.proof-hit-card{border:1px solid var(--line);background:#fff;border-radius:8px;min-width:9.5rem;padding:.5rem .65rem}.proof-hit-meta{flex-wrap:wrap;align-items:center;gap:.35rem;display:flex}.proof-edit-modal .line-photo-slots{margin-top:.5rem}.proof-edit-modal .line-photo-slot{margin-bottom:.65rem}.summary-proof-cell{flex-direction:column;align-items:flex-start;gap:.35rem;display:flex}.summary-proof-thumbs{align-items:center;gap:.35rem;display:inline-flex}.line-photo-empty.mini{text-align:center;width:48px;height:48px;padding:.2rem;font-size:.7rem;line-height:1.15}th,td{text-align:left;border-bottom:1px solid var(--line);vertical-align:top;padding:.55rem .4rem}.muted{color:var(--muted);font-size:.85rem}.err{color:var(--danger);margin:.4rem 0}.ok{color:var(--ok)}.badge{background:#e2e8f0;border-radius:999px;padding:.15rem .45rem;font-size:.78rem;display:inline-block}.thumbs{flex-wrap:wrap;gap:.5rem;display:flex}.thumbs img{object-fit:cover;border:1px solid var(--line);border-radius:8px;width:88px;height:88px}.login{place-items:center;min-height:100vh;padding:1.5rem;display:grid}.login .card{width:min(420px,100%)}.supplier-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.75rem;margin-top:.75rem;display:grid}.supplier-btn{min-height:72px;font-size:1.15rem;font-weight:600}.modal-backdrop{z-index:40;background:#0f172a8c;justify-content:center;align-items:flex-start;padding:1rem;display:flex;position:fixed;inset:0;overflow:auto}.modal{width:min(720px,100%);max-height:none;margin:1rem 0 4rem}.line-edit.unmatched select{border-color:var(--danger)}.line-edit.proof-incomplete{border-left:3px solid var(--danger);padding-left:.5rem}.line-photo-slots{flex-wrap:wrap;flex:100%;align-items:flex-start;gap:.75rem;margin-top:.35rem;display:flex}.proof-badge{border-radius:6px;align-self:center;padding:.2rem .5rem;font-size:.85rem;font-weight:600}.proof-badge.ok,.proof-ok{color:#166534}.proof-badge.miss,.proof-miss{color:var(--danger)}.proof-badge.ok{background:#dcfce7}.proof-badge.miss{background:#fee2e2}.line-photo-slot{border:1px dashed var(--line);border-radius:8px;min-width:7.5rem;padding:.5rem}.line-photo-slot.miss{border-color:var(--danger);background:#fff7f7}.line-photo-slot.has{border-style:solid}.line-photo-label{color:var(--muted);margin-bottom:.35rem;font-size:.85rem}.line-photo-empty{width:88px;height:88px;color:var(--muted);border:1px solid var(--line);background:#f8fafc;border-radius:8px;justify-content:center;align-items:center;font-size:.85rem;display:flex}.pool-draft-actions{flex-wrap:wrap;align-self:center;align-items:center;gap:.5rem;display:flex}.lib-upload-row{flex-wrap:wrap;gap:.75rem;margin:.5rem 0 .75rem;display:flex}.lib-upload-kind{border:1px solid var(--line);background:#f8fafc;border-radius:8px;min-width:11rem;padding:.6rem .75rem}.lib-gallery{grid-template-columns:1fr 1fr;gap:.75rem;display:grid}@media (width<=720px){.lib-gallery{grid-template-columns:1fr}}.mobile-tabs{display:none}.receive-mobile .mobile-tabs{z-index:20;background:var(--bg);border-bottom:1px solid var(--line);grid-template-columns:repeat(3,1fr);gap:.35rem;margin:0 0 .35rem;padding:.35rem 0 .65rem;display:grid;position:sticky;top:0}.mobile-tabs button{color:#0f172a;background:#e2e8f0;border:0;border-radius:10px;min-height:2.5rem;font-weight:600}.mobile-tabs button.active{background:var(--brand);color:#fff}label.upload-primary,button.upload-primary{background:var(--brand);min-height:2.75rem;color:var(--brand-ink);cursor:pointer;border:0;border-radius:10px;justify-content:center;align-items:center;padding:.55rem 1rem;font-weight:600;display:inline-flex}.thumb-expand-btn{width:100%;margin-top:.45rem}.lib-gallery-title{margin-bottom:.35rem;font-size:.9rem;font-weight:600}.lib-thumbs{flex-wrap:wrap;align-items:flex-start;gap:.4rem;display:flex}.lib-thumbs.pick{max-height:60vh;overflow:auto}.lib-thumb{flex-direction:column;align-items:center;gap:.2rem;display:flex}.lib-thumb-del{min-height:1.6rem;padding:.1rem .4rem;font-size:.75rem}.lib-thumb-actions{flex-wrap:wrap;justify-content:center;gap:.2rem;max-width:6.5rem;display:flex}.lib-pick-btn{border:2px solid #0000}.lib-pick-btn:hover{border-color:#2563eb}.pool-slots{flex-direction:column;gap:.85rem;display:flex}.pool-slot-card{border:1px solid var(--line);background:#fff;border-radius:10px;padding:.75rem}.pool-add-btn{min-width:2.6rem;font-size:1.25rem;font-weight:600;line-height:1}.pool-list{flex-direction:column;gap:.5rem;margin-top:.75rem;display:flex}.pool-list-row{border-top:1px solid var(--line);flex-wrap:wrap;align-items:center;gap:.5rem;padding:.4rem 0;display:flex}.slip-thumb.mini img{width:48px;height:48px}.slip-thumb.ocr-busy{outline:2px solid var(--brand);outline-offset:2px;opacity:.85}.sr-only-file{clip:rect(0, 0, 0, 0);border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}button.linkish{color:var(--brand);cursor:pointer;background:0 0;border:0;min-height:auto;padding:0;text-decoration:underline}.slip-list{flex-direction:column;gap:.75rem;display:flex}.slip-row{border-bottom:1px solid var(--line);align-items:flex-start;gap:.75rem;padding:.65rem 0;display:flex}.slip-row:last-child{border-bottom:0}.slip-thumb{cursor:zoom-in;background:0 0;border:0;min-height:0;padding:0;display:block}.slip-thumb img{object-fit:cover;border:1px solid var(--line);border-radius:8px;width:88px;height:88px;display:block}.slip-meta{flex:1;min-width:0}.img-preview-backdrop{z-index:60;background:#0f172ae0;justify-content:center;align-items:center;padding:1rem;display:flex;position:fixed;inset:0}.img-preview{object-fit:contain;border-radius:8px;max-width:min(96vw,1200px);max-height:90vh;box-shadow:0 8px 32px #00000059}.img-preview.img-preview-orig{max-width:98vw;max-height:88vh}.img-preview-toolbar{z-index:61;flex-wrap:wrap;justify-content:center;align-items:center;gap:.5rem;max-width:calc(100vw - 6rem);display:flex;position:fixed;top:.85rem;left:50%;transform:translate(-50%)}.img-preview-close{z-index:61;color:#0f172a;background:#fff;border-radius:999px;width:44px;height:44px;min-height:44px;padding:0;font-size:1.6rem;line-height:1;position:fixed;top:.75rem;right:.75rem}.ocr-raw{margin:.5rem 0 .9rem;font-size:.85rem}.ocr-raw pre{white-space:pre-wrap;word-break:break-word;border:1px solid var(--line);background:#f8fafc;border-radius:8px;max-height:180px;margin:.4rem 0 0;padding:.6rem;overflow:auto}@media (width<=860px){.layout{grid-template-columns:1fr}.side{display:none}.botnav{display:grid}.hide-sm{display:none}.invoice-metrics{grid-template-columns:1fr}table,thead,tbody,th,td,tr{display:block}thead{display:none}tr{background:var(--card);border:1px solid var(--line);border-radius:10px;margin-bottom:.55rem;padding:.6rem}td{border:0;padding:.2rem 0}td:before{content:attr(data-label);color:var(--muted);font-size:.75rem;display:block}.ref-table{display:table}.ref-table thead{display:table-header-group}.ref-table tbody{display:table-row-group}.ref-table tr{background:0 0;border:0;margin:0;padding:0;display:table-row}.ref-table th,.ref-table td{display:table-cell}.ref-table td:before{content:none}}
