:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:#172d3b;background:#f5f7f9;font-size:14px;--blue:#245edb;--line:#e6ebef;--muted:#6e7c89}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:0;border-radius:7px;padding:11px 16px;font-weight:600;transition:background .15s}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){filter:brightness(.96)}input,select{border:1px solid #dce3e9;border-radius:6px;padding:10px 12px;background:white;color:inherit}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #a5c4ff;outline-offset:2px}h1,h2,h3,p{margin:0}h1{font-size:34px;line-height:1.18;letter-spacing:-1px;font-weight:650}h2{font-size:19px;letter-spacing:-.35px}h3{font-size:15px}.sidebar{width:222px;position:fixed;inset:0 auto 0 0;background:#132936;color:#e3ecf2;padding:30px 16px}.brand{display:flex;align-items:center;gap:10px;font-size:18px;font-weight:650;line-height:1.15;padding:0 10px}.brand-mark{background:#3475f1;color:white;border-radius:10px;font-size:17px;padding:13px 9px;letter-spacing:-1px}.workspace{font-size:10px;letter-spacing:1.8px;color:#7e99aa;margin:46px 12px 14px}.nav{width:100%;text-align:left;color:#aabcc7;background:none;margin:3px 0;padding:13px 12px;font-size:13px}.nav.active{color:white;background:#254354}.sidebar-bottom{position:absolute;bottom:28px;left:27px;font-size:12px;color:#aec1ce}.sidebar-bottom p{font-size:11px;color:#7793a4;line-height:1.8;margin-top:14px}.connection-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#68d8b2;margin-right:5px}main{margin-left:222px;max-width:1650px;padding:0 42px}header{height:81px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:36px}.breadcrumb{font-size:12px;color:var(--muted)}.breadcrumb span{padding:0 10px;color:#aab5bd}.quiet{background:none;color:var(--muted);font-size:12px;padding:8px}.intro{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.eyebrow{font-size:10px;letter-spacing:1.8px;color:var(--blue);font-weight:700;margin-bottom:12px}.intro p{color:var(--muted);margin-top:12px;line-height:1.7}.version{white-space:nowrap;font-size:11px;background:#eef2f5;border:1px solid #dce4e9;border-radius:99px;padding:8px 12px;margin-top:26px;color:#607483}.notice{background:#fff7e8;color:#876326;border:1px solid #f1e2bf;border-radius:8px;padding:13px 16px;line-height:1.6;font-size:12px;margin:22px 0}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin:24px 0}.metric{background:#fff;border:1px solid var(--line);border-radius:9px;padding:19px 21px}.metric-label{font-size:12px;color:var(--muted)}.metric-number{font-size:30px;letter-spacing:-1px;line-height:1.4;font-weight:600;margin-top:7px}.metric-note{font-size:11px;color:#93a0aa;margin-top:3px}.panel{background:white;border:1px solid var(--line);border-radius:10px;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:24px}.panel-head p{font-size:12px;color:var(--muted);margin-top:9px;line-height:1.7}.panel-head h2 span{font-size:12px;color:#7b8a96;background:#eef2f5;padding:3px 7px;border-radius:5px;margin-left:5px}.actions{display:flex;align-items:center;gap:9px}.primary{background:var(--blue);color:white;font-size:12px}.secondary{background:white;border:1px solid #dbe3ea;color:#344a5d;font-size:12px}.filter-bar{padding:0 24px 20px;display:flex;gap:12px;align-items:center}.search{flex:1;max-width:420px;font-size:12px}.filter-bar select{font-size:12px}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:left}th{font-size:10px;text-transform:uppercase;letter-spacing:.6px;font-weight:600;color:#81909b;background:#f8fafb;padding:14px 22px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap}td{padding:18px 22px;border-bottom:1px solid var(--line);font-size:12px}tr.clickable{cursor:pointer}tr.clickable:hover{background:#fafcff}.supplier{font-weight:600;font-size:13px}.sub{font-size:11px;color:var(--muted);margin-top:6px;line-height:1.5}.right{text-align:right;white-space:nowrap}.amount{font-variant-numeric:tabular-nums;font-weight:600;font-size:13px}.badge{display:inline-block;white-space:nowrap;border-radius:5px;font-size:10px;padding:6px 9px;font-weight:500;background:#edf3ff;color:#426daf}.badge.blocked,.badge.uncertain,.badge.error{background:#fff4e3;color:#a47427}.badge.draft_created{background:#e6f7ee;color:#348560}.badge.sending{background:#ecedfa;color:#6563af}.panel-foot{padding:14px 24px;display:flex;justify-content:space-between;font-size:10px;color:#8997a1;gap:10px}.how{display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin:30px 0}.how>div{position:relative;padding-left:36px}.how span{position:absolute;left:0;top:0;font-size:11px;color:#7c93a3;border:1px solid #d8e2e9;border-radius:50%;padding:6px}.how h3{font-size:12px;font-weight:600;margin:3px 0 7px}.how p{font-size:11px;color:#7b8d99;line-height:1.7}footer{border-top:1px solid var(--line);padding:18px 0 24px;font-size:10px;color:#94a1ab;line-height:1.8}.detail{margin-top:24px}.detail .panel-head{align-items:flex-start}.detail-meta{display:flex;gap:35px;padding:0 24px 20px}.detail-meta small{display:block;color:var(--muted);font-size:10px;margin-bottom:6px}.detail-meta strong{font-size:13px;font-weight:600}.detail .notice{margin:0 24px 20px}.detail-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:20px 24px}.mapped{color:#348560;font-size:11px}.mapping-button{padding:7px 10px;color:var(--blue);background:#eef3ff;font-size:11px}.feedback{color:#5c7588;font-size:12px;line-height:1.7;margin-top:12px}.detail-feedback{padding:0 24px 24px;line-height:1.7;color:#60798a;font-size:12px}.empty{text-align:center;padding:55px 24px;color:#8b99a5;line-height:1.8}.small{font-size:11px;color:#7c8c97;line-height:1.8;margin-top:16px}dialog{border:1px solid var(--line);border-radius:13px;padding:28px;max-width:650px;width:calc(100% - 36px);color:inherit;box-shadow:0 20px 90px #09203740}dialog::backdrop{background:#142e4366;backdrop-filter:blur(2px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}dialog>p{line-height:1.7;color:#6b7f8e;font-size:12px}.setup-card{background:#f7f9fb;border:1px solid var(--line);padding:18px;border-radius:8px;margin-top:18px}.setup-card p{font-size:12px;line-height:1.7;color:#6d7e8b;margin:10px 0 14px}.setup-card a{color:var(--blue)}.date-row{display:flex;gap:18px;margin:24px 0}.date-row label{font-size:12px;color:#708391;flex:1}.date-row input{display:block;width:100%;margin-top:8px}#catalogSearch{flex:1;min-width:0}#catalogResults{margin-top:18px}.catalog-row{width:100%;text-align:left;padding:15px;background:white;border-bottom:1px solid var(--line);border-radius:0;font-weight:500;font-size:13px}#authBox{font-size:13px;line-height:2;margin-top:12px}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#173244;color:white;border-radius:8px;padding:14px 21px;box-shadow:0 5px 25px #16334833;max-width:650px;z-index:10;font-size:12px;line-height:1.6}[hidden]{display:none!important}@media(max-width:1100px){main{padding:0 24px}.sidebar{width:185px}main{margin-left:185px}.panel-head{align-items:flex-start;flex-direction:column}.metrics{gap:9px}.metric{padding:15px}.how{gap:15px}}@media(max-width:760px){.sidebar{position:static;width:auto;display:flex;padding:14px 20px}.brand{font-size:13px}.brand-mark{font-size:12px;padding:9px}.workspace,.sidebar-bottom,.nav{display:none}main{margin-left:0;padding:0 16px}header{height:55px;margin-bottom:24px}.breadcrumb{font-size:10px}header button{display:none}h1{font-size:27px}.intro p{font-size:12px}.intro{display:block}.version{display:inline-block;margin-top:14px}.metrics{grid-template-columns:repeat(2,1fr)}.how{grid-template-columns:1fr;gap:16px}.panel-head{padding:20px 16px}.filter-bar{padding:0 16px 16px;flex-wrap:wrap}.search{width:100%}td,th{padding:14px 16px}.panel-foot{padding:12px 16px}.panel-foot span:last-child{display:none}.detail-meta{flex-wrap:wrap;gap:16px}.detail-controls{padding:16px}.actions{flex-wrap:wrap}.date-row{flex-direction:column}}

.bulk-bar{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:0 24px 20px;padding:16px;background:#f3f7ff;border:1px solid #e1eafd;border-radius:7px}.bulk-bar strong{font-size:12px;color:#365d9c}.bulk-bar p{font-size:11px;color:#6c8097;line-height:1.7;margin-top:5px}.pagination{display:flex;justify-content:center;align-items:center;gap:12px;padding:10px;border-bottom:1px solid var(--line);font-size:11px;color:#7b8d99}@media(max-width:760px){.bulk-bar{margin:0 16px 16px;align-items:flex-start;flex-direction:column}}

.badge.completed{background:#e6f7ee;color:#287c53}.badge.partial,.badge.ready{background:#fff4e3;color:#976815}.workflow-steps{margin:22px 24px;padding:18px;background:#f8fafc;border:1px solid #e1e8ef;border-radius:8px}.workflow-steps h3{margin-bottom:12px}.workflow-step{display:flex;justify-content:space-between;gap:14px;font-size:12px;padding:10px 0;border-bottom:1px solid #e7edf2}.operation-state{font-size:11px;color:#8698a6}.operation-state.done{color:#2c8b60}.operation-state.uncertain,.operation-state.failed{color:#a16e27}.workflow-steps .actions{margin-top:14px}.invoice-heading{margin-top:22px}.invoice-form{display:grid;gap:16px;margin:22px 0}.invoice-form label{display:grid;gap:7px;font-size:12px;color:#6c8090}.invoice-form .checkbox-label{display:flex;align-items:center;gap:10px;line-height:1.6}.checkbox-label input{width:16px;height:16px}

.online-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid #e1e8ee;padding:11px 0;font-size:11px;color:#728797}.online-bar .quiet{font-size:11px}.team-user{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:14px 0;border-bottom:1px solid #e7edf2;font-size:12px}#inviteLink{width:100%;font-size:11px;margin-top:12px}#teamUsers{margin-top:20px}

/* Connection wizard: one guided step at a time. */
#setupDialog{max-width:760px;max-height:90vh;overflow-y:auto;padding:28px}
#setupDialog .dialog-head{align-items:flex-start;gap:18px}
#setupDialog .dialog-head .eyebrow{margin-bottom:7px;font-size:9px}
#setupDialog .setup-intro{font-size:13px;line-height:1.7;max-width:620px}
.setup-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:23px 0 26px}
.setup-step{display:flex;gap:9px;align-items:center;justify-content:center;background:#f2f5f8;color:#617687;border:1px solid #e1e7ee;padding:12px 8px;font-size:12px}
.setup-step span{display:inline-flex;align-items:center;justify-content:center;border:1px solid #c6d2dd;border-radius:50%;width:24px;height:24px;font-size:11px;background:#fff;flex:none}
.setup-step.current{background:#edf3ff;border-color:#9cb8ef;color:#234f9e}
.setup-step.current span{background:#245edb;color:#fff;border-color:#245edb}
.setup-step.complete:not(.current) span{background:#e6f7ee;color:#287c53;border-color:#b7dcc7}
.setup-pane h3{font-size:17px;line-height:1.5}
.setup-copy{font-size:12px;line-height:1.75;color:#5c7180;margin:10px 0 17px}
.setup-help{background:#f6f8fb;border:1px solid #e3e9ef;border-radius:8px;padding:13px 16px;margin:18px 0;color:#526b7c;font-size:12px;line-height:1.75}
.setup-help summary{cursor:pointer;font-weight:600;color:#365e8a;list-style-position:inside}
.setup-help summary:focus-visible{outline:3px solid #a5c4ff;outline-offset:4px}
.setup-help ol{padding-left:20px;margin:14px 0 9px}
.setup-help li{padding-left:3px;margin-bottom:8px}
.setup-help a,#authBox a{color:#245edb;text-decoration:underline;text-underline-offset:3px}
.setup-help p{margin-top:10px;font-size:11px}
.connection-form{display:grid;gap:16px;margin:22px 0 12px}
.connection-form label,.connection-company label{display:grid;gap:8px;font-size:12px;font-weight:600;color:#405c70}
.connection-form input,.connection-company select{width:100%;min-width:0;font-weight:400;font-size:13px}
.connection-form input[readonly]{background:#f2f5f7;color:#69808f}
.setup-hint{font-size:11px;line-height:1.7;color:#718391;margin:10px 0 18px}
#setupDialog .actions{flex-wrap:wrap}
.setup-feedback{font-size:12px;line-height:1.75;background:#eef3f8;border:1px solid #dce5ee;border-radius:7px;padding:12px 14px;margin:15px 0;color:#4a6478}
.setup-feedback.error{background:#fff2ee;border-color:#f2d5cc;color:#9c4c34}
.setup-feedback.success{background:#edf8f1;border-color:#cce8d8;color:#2c7951}
#authBox:not(:empty){background:#f4f7fc;border-radius:7px;padding:12px 16px;font-size:12px;margin:14px 0}
#authBox p{line-height:1.7;margin:3px 0 8px}
.connection-company{border-top:1px solid #e5eaf0;padding-top:20px;margin-top:22px}
.connection-company .actions{margin-top:12px}
.setup-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #e5eaf0;margin-top:26px;padding-top:20px}
.connection-checks{border:1px solid #e1e8ef;border-radius:9px;overflow:hidden;margin:20px 0}
.connection-check{display:flex;gap:12px;padding:16px;border-bottom:1px solid #e9eef3;align-items:flex-start;background:#fff}
.connection-check:last-child{border-bottom:0}
.connection-check-icon{display:flex;justify-content:center;align-items:center;width:23px;height:23px;flex:none;border-radius:50%;background:#edf1f5;color:#8395a3;font-size:13px}
.connection-check.done .connection-check-icon{background:#e7f6ed;color:#2c8659}
.connection-check strong{display:block;font-size:12px;line-height:1.7}
.connection-check p{font-size:11px;line-height:1.7;color:#758897;margin-top:3px;overflow-wrap:anywhere}
@media(max-width:760px){header #setupTop{display:block;font-size:10px}#setupDialog{padding:20px;max-height:94vh}.setup-steps{gap:5px}.setup-step{gap:5px;font-size:11px;padding:10px 5px}.setup-step span{width:20px;height:20px}.setup-navigation{flex-wrap:wrap}.setup-navigation button{flex:1}.connection-form input{font-size:16px}}

/* Public static shell: the session lives only in this page's memory. */
body.frontend-locked>.sidebar,body.frontend-locked>main{display:none}
.frontend-access{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}
.frontend-brand-panel{background:#132d3d;color:#edf4f8;padding:48px 64px;display:flex;flex-direction:column;justify-content:space-between;min-height:100vh}
.frontend-brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:650}
.frontend-brand b{display:grid;place-items:center;width:43px;height:43px;border-radius:10px;background:#2f6ee7;font-size:16px}
.frontend-brand-copy{padding:40px 0}
.frontend-brand-copy .eyebrow{color:#79abff;margin:0 0 24px;font-size:10px}
.frontend-brand-copy h1{font-size:clamp(34px,4vw,56px);line-height:1.13;letter-spacing:-1.6px;margin:0 0 24px;font-weight:600}
.frontend-brand-copy>p:not(.eyebrow){max-width:420px;line-height:1.9;color:#afc4d2;font-size:14px}
.frontend-brand-copy ol{padding-left:22px;margin-top:30px;color:#b5cbd9;font-size:13px;line-height:2.5}
.frontend-brand-foot{font-size:11px;color:#8ca7b7;line-height:1.8;max-width:380px}
.frontend-form-panel{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 36px;gap:25px}
.frontend-access-card{background:#fff;border:1px solid #e2e8ee;border-radius:13px;max-width:440px;width:100%;padding:36px}
.frontend-small-label{color:#7c91a1;font-size:10px;letter-spacing:1.4px;font-weight:600;margin:0 0 16px}
.frontend-access-card h2{font-size:29px;line-height:1.2;letter-spacing:-.7px;margin:0 0 12px;font-weight:600}
.frontend-subtitle{font-size:12px;line-height:1.8;color:#718795;margin:0 0 24px}
#frontendAccessForm label{display:grid;gap:9px;font-size:12px;font-weight:500;margin-top:19px}
#frontendAccessForm input{width:100%;font-size:14px;padding:12px}
#frontendAccessForm button{width:100%;margin-top:24px;font-size:13px;padding:13px}
.frontend-form-hint{font-size:11px;line-height:1.7;color:#7a8d9b;margin-top:13px}
#frontendError{color:#a1503d;font-size:12px;line-height:1.7;background:#fff2ef;border:1px solid #f0d8d0;padding:11px 13px;border-radius:7px;margin-top:17px}
.frontend-access-note{margin-top:24px;padding-top:19px;border-top:1px solid #edf0f3;color:#7a8d9b;font-size:11px;line-height:1.8}
.frontend-footer-note{max-width:380px;text-align:center;color:#8599a7;font-size:10px;line-height:1.8}
@media(max-width:1000px){.frontend-brand-panel{padding:38px}.frontend-access-card{padding:28px}.frontend-form-panel{padding:30px 20px}}
@media(max-width:680px){.frontend-access{display:block}.frontend-brand-panel{min-height:auto;padding:23px 25px}.frontend-brand-copy,.frontend-brand-foot{display:none}.frontend-brand{font-size:16px}.frontend-brand b{width:35px;height:35px;font-size:14px}.frontend-form-panel{padding:32px 20px}.frontend-access-card{max-width:440px}.frontend-access-card h2{font-size:26px}#frontendAccessForm input{font-size:16px}}

.frontend-footer-note a{display:inline-block;color:#245edb;text-decoration:underline;text-underline-offset:3px;margin-top:9px;font-size:12px}
