:root{--ink:#17212b;--blue:#066ac9;--light:#f3f6f9;--line:#dce3ea;--green:#087f5b;--red:#c93333;--amber:#b96d00}*{box-sizing:border-box}body{margin:0;background:var(--light);color:var(--ink);font:15px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}header{min-height:66px;background:#102b46;color:#fff;display:flex;align-items:center;padding:0 4vw;gap:36px}.brand{font-size:22px;font-weight:760;color:#fff;text-decoration:none;letter-spacing:-.5px}.brand span{color:#7fc7ff}nav{display:flex;align-items:center;gap:20px;flex-wrap:wrap}nav a{color:#dcecff;text-decoration:none;font-weight:600}nav a:hover{color:#fff}main{max-width:1400px;margin:0 auto;padding:28px 4vw 56px}footer{padding:18px 4vw;color:#617181;background:#e8edf2;font-size:13px}h1{font-size:27px;margin:0 0 6px}h2{font-size:19px;margin:0 0 14px}.lead{margin:0 0 24px;color:#506274}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.card,.panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;box-shadow:0 1px 2px #14233a08}.metric{font-size:31px;font-weight:750}.metric-label{color:#627282;font-weight:650}.panel{margin:20px 0}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.button,button{appearance:none;border:0;border-radius:8px;background:var(--blue);color:white;padding:10px 14px;text-decoration:none;font:inherit;font-weight:700;cursor:pointer}.button.secondary,button.secondary{background:#e8edf2;color:#263849}.button.danger{background:var(--red)}input,select,textarea{width:100%;border:1px solid #bdc9d5;border-radius:7px;padding:9px 10px;background:#fff;font:inherit}textarea{min-height:86px}label{display:block;font-weight:680;margin:0 0 5px}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.field.full{grid-column:1/-1}table{border-collapse:collapse;width:100%;background:#fff}th,td{text-align:left;padding:10px;border-bottom:1px solid var(--line);vertical-align:top}th{font-size:12px;letter-spacing:.03em;text-transform:uppercase;color:#5b6d7e;background:#f8fafb}.table-wrap{overflow:auto}.badge{display:inline-block;border-radius:999px;padding:3px 9px;background:#e8edf2;font-size:12px;font-weight:750}.badge.ok{background:#d9f3e8;color:#076547}.badge.danger{background:#ffe2e2;color:#a31919}.badge.info{background:#ddecff;color:#075ca8}.badge.muted{background:#edf1f4;color:#526476}.flash{padding:12px 14px;border-radius:8px;background:#d9f3e8;color:#075b40;margin-bottom:18px;font-weight:650}.flash.error{background:#ffe2e2;color:#9f1d1d}.flash.info{background:#ddecff;color:#075ca8}.flash.warning,.notice.warning{background:#fff1cf;color:#815000;padding:12px 14px;border-radius:8px}.hint{color:#627282;font-size:13px}.filters{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.filters .field{min-width:160px;flex:1}.order-title{font-size:20px;font-weight:750}.mobile-page main{max-width:760px}.mobile-order{display:block;color:inherit;text-decoration:none;border-left:5px solid var(--blue);margin:12px 0}.mobile-order .meta{color:#5a6c7d;font-size:14px}.danger-text{color:#a31919;font-weight:700}@media(max-width:800px){header{padding:13px 5vw;align-items:flex-start;flex-direction:column;gap:8px}main{padding:22px 5vw}.grid{grid-template-columns:repeat(2,1fr)}.form-grid,.form-grid.two{grid-template-columns:1fr}th,td{padding:8px;font-size:13px}nav{gap:12px;font-size:14px}}@media(max-width:460px){.grid{grid-template-columns:1fr}.button,button{width:100%;text-align:center}}
.scan-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch}.scan-row .scan-button{white-space:nowrap}.scan-result:empty{display:none}.scan-result.scan-ok{color:var(--green);font-weight:700}.scan-fallback[hidden]{display:none}.scan-dialog{border:0;border-radius:14px;padding:0;max-width:min(92vw,560px);width:100%;box-shadow:0 24px 80px #0006}.scan-dialog::backdrop{background:#071421b8}.scan-shell{padding:18px}.scan-video{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:#0b1722;border-radius:10px;margin:10px 0}.scan-status{min-height:2.8em;color:#506274}@media(max-width:460px){.scan-row{grid-template-columns:1fr}.scan-row .scan-button{width:100%}}
.sync-banner{display:grid;grid-template-columns:10px auto;column-gap:8px;align-items:center;background:#e3f5ed;border:1px solid #b7dfcd;border-radius:10px;padding:10px 12px;margin:0 0 16px;color:#075b40}.sync-banner [data-sync-dot]{width:9px;height:9px;border-radius:50%;background:var(--green);grid-row:1/3}.sync-banner strong{line-height:1.2}.sync-banner small{display:block;color:#4c6d60;line-height:1.25}.sync-banner.pending{background:#fff3d7;border-color:#ead49c;color:#765000}.sync-banner.pending [data-sync-dot]{background:var(--amber)}.sync-banner.pending small{color:#765f31}.sync-banner.offline{background:#eef1f4;border-color:#d0d8df;color:#394d5e}.sync-banner.offline [data-sync-dot]{background:#667887}.sync-banner.offline small{color:#607181}.sync-banner.stale{background:#fff3d7;border-color:#ead49c;color:#765000}.sync-banner.stale [data-sync-dot]{background:var(--amber)}.sync-banner.stale small{color:#765f31}.offline-shell{max-width:760px;margin:0 auto;padding:22px 5vw 56px}.offline-chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 9px;background:#eef1f4;color:#526476;font-size:12px;font-weight:750}.sync-error{color:var(--red);font-weight:650}

/* Role-focused navigation */
.header-role{display:inline-flex;align-items:center;border:1px solid #ffffff2e;background:#ffffff12;color:#dcecff;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:750;white-space:nowrap}
.dispatch-shell-version{display:inline-flex;align-items:center;border:1px solid #ffffff2e;background:#ffffff12;color:#dcecff;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800;white-space:nowrap}
nav a.active{color:#fff;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}
@media(max-width:800px){.header-role{order:2}.brand{order:1}nav{order:3;width:100%}.mobile-page header nav{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;width:100%}.mobile-page header nav a{padding:9px 10px;border-radius:8px;background:#ffffff0d}.mobile-page header nav a:last-child{text-align:right}}

.signature-pad{border:1px solid #bdc9d5;border-radius:9px;background:#fff;padding:8px}.signature-pad canvas{display:block;width:100%;height:190px;background:#fff;border:1px dashed #aebbc8;border-radius:6px;touch-action:none;cursor:crosshair}.signature-pad .actions{margin-top:8px}.signature-pad .actions button{width:auto}.signature-field{min-width:0}

/* 0.10.111: calmer desktop application shell for dispatching. */
@media (min-width: 981px){
  body.dispatch-shell-page{background:#f4f8fc;color:#14283b;min-height:100vh}
  body.dispatch-shell-page .dispatch-shell-header{position:fixed;z-index:80;top:0;left:0;right:0;height:72px;min-height:72px;padding:0 28px;background:#fff;color:#102b46;border-bottom:1px solid #e1e9f0;box-shadow:0 3px 18px rgba(25,53,76,.05);gap:18px}
  body.dispatch-shell-page .dispatch-shell-header .brand{display:inline-flex;align-items:center;gap:10px;color:#102b46;font-size:22px;font-weight:800;letter-spacing:-.55px;white-space:nowrap}
  body.dispatch-shell-page .dispatch-shell-header .brand::before{content:"";display:inline-block;width:25px;height:25px;border-radius:8px 12px 8px 12px;background:linear-gradient(135deg,#25b9c7 0 46%,#0b72ce 46% 100%);transform:rotate(8deg);box-shadow:0 3px 10px rgba(15,119,194,.18)}
  body.dispatch-shell-page .dispatch-shell-header .brand span{color:#178bd2}
  body.dispatch-shell-page .dispatch-shell-section{padding-left:18px;border-left:1px solid #d9e3ec;font-size:19px;font-weight:800;color:#162b42;white-space:nowrap}
  body.dispatch-shell-page .dispatch-shell-version{background:#eef5fb;border-color:#d8e6f1;color:#42627d}
  body.dispatch-shell-page .dispatch-shell-spacer{flex:1}
  body.dispatch-shell-page .dispatch-shell-user{display:flex;align-items:center;gap:9px;color:#23384d;min-width:0}
  body.dispatch-shell-page .dispatch-shell-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:#0b6fcb;color:#fff;font-size:12px;font-weight:900;box-shadow:0 4px 12px rgba(10,96,180,.18)}
  body.dispatch-shell-page .dispatch-shell-user-name{max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:750}
  body.dispatch-shell-page .header-role{background:#eef5fb;border:1px solid #d8e6f1;color:#52697e;padding:4px 8px}
  body.dispatch-shell-page .dispatch-shell-nav{position:fixed;z-index:75;top:72px;left:0;bottom:0;width:220px;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:6px;padding:22px 14px 18px;background:linear-gradient(180deg,#183552 0%,#132b45 100%);overflow-y:auto;box-shadow:4px 0 18px rgba(16,43,70,.08)}
  body.dispatch-shell-page .dispatch-shell-nav a{position:relative;display:flex;align-items:center;min-height:44px;padding:10px 13px 10px 38px;border-radius:9px;color:#dce8f4;text-decoration:none;font-weight:700;line-height:1.2;transition:background .15s,color .15s,transform .15s}
  body.dispatch-shell-page .dispatch-shell-nav a::before{content:"";position:absolute;left:15px;width:10px;height:10px;border:2px solid #9db7cf;border-radius:3px;opacity:.9}
  body.dispatch-shell-page .dispatch-shell-nav a:hover{background:#ffffff12;color:#fff;transform:translateX(1px)}
  body.dispatch-shell-page .dispatch-shell-nav a.active{background:linear-gradient(90deg,#0d77d3,#126fc1);color:#fff;text-decoration:none;box-shadow:0 7px 18px rgba(5,79,143,.22)}
  body.dispatch-shell-page .dispatch-shell-nav a.active::before{border-color:#fff;background:#ffffff28}
  body.dispatch-shell-page .dispatch-shell-nav a:last-child{margin-top:auto;border-top:1px solid #ffffff18;border-radius:0;padding-top:17px}
  body.dispatch-shell-page .dispatch-shell-main{max-width:none;margin:72px 0 0 220px;padding:32px clamp(24px,2.2vw,42px) 64px;min-height:calc(100vh - 72px)}
  body.dispatch-shell-page .dispatch-shell-footer{margin-left:220px;padding:18px clamp(24px,2.2vw,42px);background:#fff;border-top:1px solid #e1e9f0;color:#6a7b8b}
  body.dispatch-shell-page .panel,body.dispatch-shell-page .card{border-color:#dfe7ee;box-shadow:0 7px 24px rgba(34,65,88,.055)}
  body.dispatch-shell-page .button,body.dispatch-shell-page button{border-radius:9px;box-shadow:0 3px 8px rgba(6,106,201,.12)}
  body.dispatch-shell-page .button.secondary,body.dispatch-shell-page button.secondary{background:#f0f5f9;color:#29445c;border:1px solid #d7e2ea;box-shadow:none}
  body.dispatch-shell-page input,body.dispatch-shell-page select,body.dispatch-shell-page textarea{border-color:#c9d7e2;box-shadow:inset 0 1px 2px rgba(33,61,83,.025);transition:border-color .15s,box-shadow .15s}
  body.dispatch-shell-page input:focus,body.dispatch-shell-page select:focus,body.dispatch-shell-page textarea:focus{outline:none;border-color:#5ca5dc;box-shadow:0 0 0 3px rgba(58,143,207,.12)}
}
@media (max-width:980px){
  body.dispatch-shell-page .dispatch-shell-section,body.dispatch-shell-page .dispatch-shell-spacer,body.dispatch-shell-page .dispatch-shell-user{display:none}
}

/* 0.10.112: responsive shell sizing. The dispatch main used width:100% together
   with a 220px left margin, which made the page wider than the viewport. */
body.dispatch-shell-page{max-width:100%;overflow-x:hidden}
@media (min-width:981px){
  body.dispatch-shell-page .dispatch-shell-main{
    width:calc(100% - 220px);
    max-width:none;
    min-width:0;
    margin-left:220px;
    margin-right:0;
    overflow-x:clip;
  }
  body.dispatch-shell-page .dispatch-shell-main>*{min-width:0;max-width:100%}
  body.dispatch-shell-page .dispatch-shell-footer{
    width:calc(100% - 220px);
    max-width:none;
    margin-left:220px;
    margin-right:0;
  }
}
@media (min-width:981px) and (max-width:1180px){
  body.dispatch-shell-page .dispatch-shell-nav{width:196px}
  body.dispatch-shell-page .dispatch-shell-main{width:calc(100% - 196px);margin-left:196px;padding-left:18px;padding-right:18px}
  body.dispatch-shell-page .dispatch-shell-footer{width:calc(100% - 196px);margin-left:196px;padding-left:18px;padding-right:18px}
}
@media (max-width:980px){
  body.dispatch-shell-page{overflow-x:hidden}
  body.dispatch-shell-page .dispatch-shell-header{width:100%;max-width:100%}
  body.dispatch-shell-page .dispatch-shell-nav{width:100%;min-width:0;display:flex;flex-wrap:wrap;gap:8px}
  body.dispatch-shell-page .dispatch-shell-main{width:100%;max-width:none;min-width:0;margin:0;padding:22px 4vw 48px;overflow-x:clip}
  body.dispatch-shell-page .dispatch-shell-footer{width:100%;max-width:none;margin:0;padding-left:4vw;padding-right:4vw}
}
@media (max-width:800px){
  body.dispatch-shell-page .dispatch-shell-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  body.dispatch-shell-page .dispatch-shell-nav a{min-width:0;padding:8px 10px;border-radius:7px;background:#ffffff0d}
}
@media (max-width:480px){
  body.dispatch-shell-page .dispatch-shell-nav{grid-template-columns:1fr 1fr}
  body.dispatch-shell-page .dispatch-shell-main{padding-left:14px;padding-right:14px}
}

/* 0.10.126 general desktop navigation: keep every action reachable without clipping */
header:not(.dispatch-shell-header){flex-wrap:wrap}
header:not(.dispatch-shell-header)>nav{flex:1 1 760px;min-width:0;justify-content:flex-end}
@media(max-width:1180px) and (min-width:801px){header:not(.dispatch-shell-header){gap:18px;padding-top:10px;padding-bottom:10px}header:not(.dispatch-shell-header)>nav{gap:12px;font-size:14px}}
@media(max-width:800px){header:not(.dispatch-shell-header)>nav{justify-content:flex-start}}

/* 0.10.126 dashboard metric density */
.dashboard-metrics{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:1100px){.dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:460px){.dashboard-metrics{grid-template-columns:1fr}}
