:root{--nav:#14253c;--blue:#1e84ce;--teal:#12a494;--ink:#172b44;--muted:#7a8ba2;--border:#e6edf5;--bg:#f4f7fb;--radius:14px}*{box-sizing:border-box}body{margin:0;font:13px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#fff;border:1px solid #d8e3ef;border-radius:8px;padding:8px 13px;color:#375271;white-space:nowrap}button:hover{background:#f0f7fc;border-color:#99bfdf}button:disabled{opacity:.5;cursor:not-allowed}button.primary{color:#fff;background:var(--teal);border-color:var(--teal)}button.primary:hover{background:#0e8e82}button.blue{color:white;background:var(--blue);border-color:var(--blue)}button.danger{color:#c65365;background:#fff3f5;border-color:#f4d7df}button.quiet{border:0;background:none;padding:5px 8px}button:focus-visible,a:focus-visible{outline:3px solid #91c6ec;outline-offset:2px}input,select,textarea{border:1px solid #dbe5ef;border-radius:8px;padding:9px 11px;background:#fff;color:#263f5d;min-width:0}input:focus,select:focus,textarea:focus{outline:2px solid #b8e3e3;border-color:#48b8ac}input[readonly]{background:#f4f7fa;color:#7c8ca2}input[type=checkbox]{accent-color:var(--teal);width:17px;height:17px}textarea{width:100%;resize:vertical;min-height:112px;line-height:1.8}h1,h2,h3,p{margin:0}h1{font-size:25px;letter-spacing:-.5px}h2{font-size:16px}h3{font-size:14px}small{font-size:11px}.muted{color:var(--muted)}.eyebrow{font-size:10px;letter-spacing:1.6px;color:#8b9eb5;font-weight:600;margin-bottom:5px}.flex{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.between{display:flex;align-items:center;justify-content:space-between;gap:15px}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.badge{display:inline-block;border-radius:5px;padding:2px 7px;color:#4e7198;background:#edf4fc;font-size:10px;white-space:nowrap}.badge.ok{color:#258868;background:#e8f8ef}.badge.warn{color:#a07727;background:#fff5de}.badge.bad{color:#b55465;background:#fff0f2}.badge.gray{color:#8895a9;background:#f0f3f7}.green{color:#159674}.money{font-variant-numeric:tabular-nums;font-weight:600}.mono{font:11px/1.6 ui-monospace,Consolas,monospace;overflow-wrap:anywhere}a{color:#1d80c7}label{display:flex;flex-direction:column;gap:5px;color:#607a98;font-size:12px}.full{grid-column:1/-1}.hint{font-size:11px;color:#8797ac;line-height:1.9;margin-top:7px}.notice{padding:11px 15px;background:#fff8e9;border:1px solid #f3e6c5;border-radius:9px;color:#937347;font-size:11px;margin-bottom:20px;display:flex;gap:10px;align-items:flex-start}.notice strong{white-space:nowrap}.error{padding:9px 12px;color:#b14f60;background:#fff1f3;border:1px solid #f4d9df;border-radius:8px;margin:12px 0}.success{color:#197d65;background:#eaf8f2;padding:12px;border-radius:8px}.panel{background:white;border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 5px 17px #28425a04;margin-bottom:20px;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 20px;border-bottom:1px solid var(--border)}.panel-body{padding:20px}.panel-foot{padding:12px 20px;border-top:1px solid var(--border);font-size:11px;color:var(--muted)}.filters{display:flex;gap:9px;flex-wrap:wrap;padding:17px 18px;border-bottom:1px solid var(--border)}.filters input{width:180px}.filters select{max-width:190px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:11px;white-space:nowrap}thead{background:#f7f9fc}th{font-weight:500;color:#758ba5;padding:12px 13px;text-align:left}td{padding:13px;border-top:1px solid #eaf0f6;vertical-align:middle}tbody tr:hover{background:#fbfdff}td.numeric,th.numeric{text-align:right}td .sub{display:block;font-size:10px;color:#8d9fb6;max-width:260px;white-space:normal;overflow-wrap:anywhere}td .name{display:block;max-width:260px;white-space:normal;overflow-wrap:anywhere;font-weight:600}.cell-actions{display:flex;gap:5px}.cell-actions button{padding:4px 8px;font-size:10px}.sort-button{border:0;background:none;padding:0;font-size:11px;color:inherit}.sort-button b{font-size:9px;color:#2697cb;margin-left:5px}.empty{padding:38px 20px;text-align:center;white-space:normal;color:#8b9db2;line-height:2}.pagination{padding:12px 18px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;color:#8596ab;font-size:11px}.pagination button{padding:5px 10px}.pagination select{padding:4px}.metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;padding:18px}.metric{background:linear-gradient(120deg,#eafafe,#e8f1ff);padding:16px;border-radius:11px;min-height:101px;overflow:hidden}.metric:nth-child(2){background:linear-gradient(120deg,#edfdf5,#e4f9ed)}.metric:nth-child(3){background:linear-gradient(120deg,#fff7ee,#fff0dd)}.metric:nth-child(4){background:linear-gradient(120deg,#f2f2ff,#eaedff)}.metric:nth-child(5){background:linear-gradient(120deg,#edf5ff,#e5eefb)}.metric:nth-child(6){background:linear-gradient(120deg,#e9faf6,#ddf5ee)}.metric small{color:#788ea6}.metric strong{display:block;font-size:26px;line-height:1.5;margin-top:10px;letter-spacing:-.5px}.split{display:grid;grid-template-columns:1fr 1fr;gap:20px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-actions{display:flex;gap:9px;align-items:center;justify-content:flex-end;margin-top:20px}.check-field{display:flex;flex-direction:row;align-items:center;gap:9px;padding:11px 12px;background:#f5f8fc;border-radius:8px;min-height:42px}.code{background:#15283f;color:#d6e4f4;padding:15px;border-radius:9px;font:11px/1.9 ui-monospace,Consolas,monospace;white-space:pre-wrap;max-height:360px;overflow:auto}.danger-text{color:#b74f5e}.info-box{background:#f2f7fe;border:1px solid #e0eaf8;padding:12px 14px;border-radius:9px;font-size:12px;color:#6b82a1;margin-bottom:18px}.chat{background:#11243a;color:#e7f0fa;border-radius:14px;overflow:hidden}.chat-head{padding:15px 18px;background:#1a324d;font-size:13px}.chat-body{min-height:200px;padding:18px}.bubble{background:#203b55;padding:13px 16px;border-radius:12px 12px 12px 3px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.9}.bubble img{width:100%;max-height:250px;object-fit:contain;display:block;margin-bottom:10px}.result-box{margin-top:15px;max-height:400px;overflow:auto}.feature-list{display:grid;grid-template-columns:1fr 1fr;gap:12px}.feature{padding:16px;background:#f7fafd;border-radius:10px}.feature strong{display:block;margin-bottom:6px}.feature p{font-size:12px;color:#8193aa}.brand-icon{display:grid;place-items:center;background:#238be0;color:#fff;border-radius:10px;width:34px;height:34px;font-weight:700;font-size:19px}.brand{display:flex;gap:11px;align-items:center;padding:0 9px 26px;color:#fff}.brand strong{font-size:16px}.brand small{display:block;color:#8ca4c2;font-size:8px;letter-spacing:1.5px}aside{position:fixed;inset:0 auto 0 0;width:220px;background:var(--nav);color:#b7c8dd;padding:26px 15px;display:flex;flex-direction:column;overflow:auto;z-index:4}.nav-label{color:#7891b0;font-size:10px;letter-spacing:1px;padding:5px 13px 12px}nav{display:grid;gap:5px}nav button{border:0;background:none;color:#b5c7dd;text-align:left;display:flex;align-items:center;gap:12px;padding:10px 14px;font-size:15px}nav button span{font-size:12px}nav button:hover{background:#203951}nav button.active{background:#205e9a;color:#fff}.side-bottom{margin-top:auto;padding:25px 12px 0;font-size:11px;color:#829bb9}.side-bottom b{display:block;color:#b3c9e4;font-weight:500;margin-bottom:7px}.side-bottom i{background:#eab959;border-radius:50%;display:inline-block;width:6px;height:6px;margin-right:5px}.shell{margin-left:220px}.shell>header{height:65px;background:white;border-bottom:1px solid var(--border);padding:0 28px;display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#8093aa}.shell>header>div{display:flex;align-items:center;gap:12px}.shell>header b{font-weight:500;color:#4e6887}main{max-width:1760px;margin:auto;padding:25px 28px}.page-heading{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-bottom:22px}.page-heading .muted{font-size:12px;margin-top:5px}footer{text-align:center;color:#a0aec0;font-size:10px;padding:16px}.backdrop{position:fixed;inset:0;background:#0b213967;backdrop-filter:blur(3px);z-index:20;display:flex;align-items:center;justify-content:center;padding:24px}.dialog{width:790px;max-width:100%;max-height:92vh;background:white;border-radius:17px;overflow:auto;box-shadow:0 18px 80px #0003}.dialog>header{padding:19px 23px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border)}.dialog>header button{border:0;padding:1px 5px;font-size:24px;color:#8a9ab0}#modal-body{padding:22px 23px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#1d374f;color:white;border-radius:9px;padding:12px 20px;max-width:90vw;z-index:50;box-shadow:0 5px 20px #0002;font-size:12px;white-space:pre-wrap}#login-screen{min-height:100vh;display:grid;place-items:center;padding:30px;background:radial-gradient(ellipse at 20% 10%,#dbeaf6,transparent 60%),#f3f7fb}.login-card{width:430px;max-width:100%;border:1px solid var(--border);border-radius:20px;padding:36px;background:#fff;box-shadow:0 14px 65px #294a7520}.login-card .brand-icon{margin-bottom:20px;width:44px;height:44px;font-size:24px}.login-card h1{font-size:24px}.login-card>.muted{font-size:12px;margin:8px 0 24px}.login-card label{margin-top:15px}.login-card>button{width:100%;margin:22px 0 18px}.login-card>small{color:#8c9db3}.login-card input{padding:11px}.wrap{white-space:normal;overflow-wrap:anywhere}.gap-top{margin-top:18px}[hidden]{display:none!important}

@media(max-width:1150px){aside{width:192px;padding:22px 11px}.shell{margin-left:192px}main{padding:22px 20px}.metrics{grid-template-columns:repeat(3,1fr)}.split{grid-template-columns:1fr}.metric strong{font-size:25px}}@media(max-width:720px){aside{position:static;width:auto;padding:15px}.brand{padding-bottom:14px}.brand small,.nav-label,.side-bottom{display:none}nav{display:flex;overflow-x:auto;gap:5px}nav button{flex-shrink:0;padding:8px 10px}nav button span{font-size:11px}.shell{margin:0}.shell>header{height:50px;padding:0 15px}main{padding:17px 12px}.notice{display:block;font-size:10px}.notice strong{display:block;margin-bottom:4px}.page-heading{flex-wrap:wrap;gap:12px}.page-heading h1{font-size:22px}.metrics{padding:11px;gap:8px}.metric{padding:12px 10px;min-height:86px}.metric strong{font-size:22px}.metric small{font-size:10px}.filters{padding:13px}.filters input,.filters select{flex:1;min-width:125px;max-width:none}.panel-head{padding:14px 15px;flex-wrap:wrap}.panel-body{padding:16px}.form-grid,.feature-list{grid-template-columns:1fr}.backdrop{padding:10px}#modal-body{padding:17px}.dialog>header{padding:16px}#admin-label{display:none}.pagination{flex-wrap:wrap;gap:10px}.login-card{padding:26px}}



.inventory-dropzone{min-height:340px;height:48vh;max-height:440px;border:1px dashed #d5dce6;border-radius:5px;display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;cursor:pointer;color:#666;background:#fff}.inventory-dropzone span{color:#169bea}.inventory-dropzone.dragging,.inventory-dropzone:focus{border-color:#169bea;background:#f1faff;outline:none}.inventory-dropzone+#inventory-upload-error{margin-top:12px}



.ledger-credit{color:#dc2626;font-weight:600}.ledger-debit{color:#16a34a;font-weight:600}



.supplier-shortcuts{display:flex;flex-wrap:wrap;gap:8px;padding:14px 20px 0}.supplier-shortcuts button{max-width:100%;white-space:normal;overflow-wrap:anywhere}



/* Slightly larger workspace text, retaining the existing layout. */

body{font-size:14px}table{font-size:13px}nav button span{font-size:14px}

small,.hint,.notice,.panel-foot,.pagination,.shell>header{font-size:12px}

td .sub,.cell-actions button,.badge{font-size:12px}.sort-button,label{font-size:13px}



.dialog.product-dialog{display:flex;flex-direction:column;overflow:hidden}.product-dialog>header{flex-shrink:0}.product-dialog #modal-body{min-height:0;display:flex;flex-direction:column;overflow:hidden}.product-dialog #edit-form{min-height:0;display:flex;flex-direction:column}.product-dialog .form-grid{overflow:auto;min-height:0;padding:2px 4px}.product-dialog .form-actions{flex-shrink:0;margin-top:12px;padding-top:12px;border-top:1px solid var(--border);background:white}.product-dialog #form-error{flex-shrink:0}

.dialog.import-report-dialog{width:min(1080px,96vw)}
.import-report-dialog #modal-body{font-size:14px}
.import-report-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.import-report-metric{padding:16px 18px;border:1px solid #dceaf1;border-radius:10px;background:#f4fafc}
.import-report-metric span{display:block;color:#59718b}
.import-report-metric strong{display:block;font-size:27px;line-height:1.35;color:#17344d}
.import-report-meta{display:flex;flex-wrap:wrap;gap:10px 24px;padding:17px 2px;color:#6b819b}
.import-report-meta b{color:#29445f;font-weight:600;overflow-wrap:anywhere}
.import-report-section{border-top:1px solid #e6edf5;padding-top:18px;margin-top:4px}
.import-report-section>h2{font-size:17px;margin-bottom:12px}
.import-report-group{padding:16px;margin-bottom:12px;border:1px solid #dce7f1;border-radius:10px;background:#fbfdff}
.import-report-group h3{font-size:15px;margin-bottom:12px}
.import-report-group h3 span{color:#7187a0;font-weight:400}
.import-report-numbers{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.import-report-numbers span{padding:8px 10px;background:#eef4fa;border-radius:6px;font:13px/1.5 ui-monospace,Consolas,monospace;overflow-wrap:anywhere}
@media(max-width:700px){.import-report-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.import-report-metric{padding:12px}.import-report-metric strong{font-size:23px}}



#toast.top-right{top:76px;right:24px;bottom:auto;left:auto;transform:none;background:#197d65}


/* Product source uses the category cell typography; CSP-safe external style. */
td .sub.product-source{font-size:inherit;color:inherit}

/* Keep sync actions visible while large catalogs scroll independently. */
.dialog.product-dialog:has(#sync-catalog){width:1200px;height:92vh;max-width:96vw}
.product-dialog:has(#sync-catalog) #modal-body{flex:1;min-height:0;padding-top:14px;padding-bottom:14px;gap:10px}
.product-dialog:has(#sync-catalog) .sync-controls{flex:0 0 auto;min-height:0;max-height:42vh;overflow:auto}
.product-dialog:has(#sync-catalog) .filters{padding:10px 0;gap:8px}
.product-dialog:has(#sync-catalog) .sync-options{display:flex;flex-wrap:wrap;gap:10px 24px;margin:8px 0}
.product-dialog:has(#sync-catalog) .sync-options label{display:inline-flex;flex-direction:row;align-items:center;gap:7px;margin:0}
.product-dialog:has(#sync-catalog) .sync-options input{width:auto;margin:0;flex:none}
#sync-catalog{flex:1 1 0;min-height:0;overflow:auto;border:1px solid var(--border);border-radius:8px}
#sync-catalog .table-wrap{overflow:visible}
#sync-catalog table{min-width:850px}
#sync-catalog thead th{position:sticky;top:0;background:#f5f8fc;z-index:1}
.product-dialog:has(#sync-catalog) .form-actions{flex:none;margin:0;padding:12px 0 0;justify-content:space-between}
#sync-submit{min-width:160px}
@media(max-width:720px){.dialog.product-dialog:has(#sync-catalog){height:94vh;max-height:94vh}.product-dialog:has(#sync-catalog) .sync-controls{max-height:38vh}#sync-submit{min-width:130px}}

/* Direct one-row workspace selection; narrow screens scroll the buttons. */
.shell>header{gap:16px}
.shell>header>.workspace-bar{display:flex;flex:1;min-width:0;gap:8px}
#workspace-label{flex-shrink:0;white-space:nowrap}
#workspace-switch{display:flex;flex:1;min-width:0;gap:6px;overflow-x:auto;flex-wrap:nowrap;padding:4px 2px}
#workspace-switch button{flex:0 0 auto;max-width:280px;overflow:hidden;text-overflow:ellipsis;padding:6px 10px}
.shell>header>span,.shell>header>div:not(.workspace-bar){flex-shrink:0}
@media(max-width:1100px){.shell>header{height:auto;min-height:65px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px;gap:8px}.shell>header>.workspace-bar{flex-basis:100%}}
button.file-suppressed{background:#c65365;border-color:#c65365;color:#fff;font-weight:700}
button.file-suppressed:hover{background:#ac4052;border-color:#ac4052}
