@font-face{font-family:system;src:local('Arial')}*{box-sizing:border-box}body{margin:0;background:#f3f5f6;color:#19242a;font:14px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid #d7dfe3;background:white;border-radius:8px;padding:9px 14px;color:inherit;font-weight:600}button:hover{border-color:#8f9ea6;background:#f4f6f7}button:disabled{opacity:.45;cursor:wait}.primary{background:#d72e39;color:white;border-color:#d72e39}.primary:hover{background:#bc2330;color:white;border-color:#bc2330}.danger{color:#b22230}.link{border:0;background:transparent;padding:0;color:#c52230}.app{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:100vh}.sidebar{background:#182429;color:#c3ced3;padding:32px 20px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column}.brand{color:white;font-size:25px;font-weight:800;letter-spacing:-1.1px}.brand span{color:#f14b52}.brand small{display:block;color:#94a9b1;letter-spacing:2px;font-size:10px;margin-top:4px}.nav{margin-top:40px;display:grid;gap:8px}.nav button{text-align:left;background:transparent;border:0;color:#b6c4ca;padding:12px}.nav button.active{background:#304047;color:white}.sidebar .bottom{margin-top:auto;font-size:12px}.sidebar select{width:100%;margin-top:8px}.workspace{padding:36px 4vw;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:25px}h1{font-size:30px;line-height:1.2;margin:0 0 8px;letter-spacing:-.7px}h2{font-size:19px;margin:0 0 14px}h3{font-size:15px;margin:0 0 12px}.muted{color:#718189}.eyebrow{font-size:11px;font-weight:700;letter-spacing:1.5px;color:#8a969d;text-transform:uppercase}.demo{background:#fff1d6;color:#815b1d;border:1px solid #efdba8;border-radius:8px;padding:10px 14px;margin-bottom:24px;font-size:12px}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}.metric,.card{background:white;border:1px solid #e1e7ea;border-radius:12px;padding:22px}.metric b{display:block;font-size:26px;margin-top:8px;letter-spacing:-.5px}.metric span{color:#77858d;font-size:12px}.bar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:20px}.bar input{max-width:320px}.right{margin-left:auto}.tablewrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left}th{color:#7d8b93;font-size:11px;letter-spacing:.4px;font-weight:600;padding:12px 10px;background:#f7f9fa;white-space:nowrap}td{padding:15px 10px;border-bottom:1px solid #edf0f2;vertical-align:middle}td small{display:block;color:#8a969d;font-size:11px}tr:last-child td{border-bottom:0}.badge{display:inline-block;border-radius:6px;padding:5px 8px;font-size:11px;font-weight:650;background:#edf1f4;color:#556873;white-space:nowrap}.badge.review{background:#fff0d2;color:#946315}.badge.approved{background:#e6f3ed;color:#267454}.badge.cancelled{background:#f8e8eb;color:#a94754}.grid2{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);gap:20px}.stack{display:grid;gap:18px;align-content:start}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}label{display:block;font-size:12px;color:#61737d;margin-bottom:12px}input,select,textarea{display:block;width:100%;margin-top:5px;border:1px solid #d6dfe4;background:white;color:#25363f;border-radius:7px;padding:10px;min-height:40px}input[type=checkbox]{width:17px;min-height:17px;display:inline-block;margin:0 8px 0 0;vertical-align:middle}textarea{min-height:80px;resize:vertical}input[type=number]{min-width:75px}td input{max-width:130px}.check{display:flex;align-items:center}.summary{padding:15px 0;border-top:1px solid #e4e9ec;display:flex;justify-content:space-between;font-size:16px;font-weight:700}.note{padding:12px 14px;border-radius:8px;background:#f5f8f9;font-size:12px;color:#61737d}.warn{background:#fff5e2;color:#906622}.steps{display:flex;gap:6px;margin:16px 0;flex-wrap:wrap}.steps span{font-size:11px;color:#88959d;padding:5px 8px;background:#f1f4f6;border-radius:5px}.steps .current{background:#e6f3ed;color:#267454}.history{max-height:280px;overflow:auto}.event{padding:10px 0;border-bottom:1px solid #edf0f2;font-size:12px}.event small{display:block;color:#92a0a7}.empty{text-align:center;padding:55px 20px;color:#819098}.empty b{display:block;color:#465d68;font-size:19px;margin-bottom:10px}.photos{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.photos img{width:130px;height:95px;object-fit:cover;border-radius:7px;border:1px solid #e1e7ea;cursor:pointer}.batch{padding-top:15px;margin-top:15px;border-top:1px solid #e1e7ea}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.login{max-width:440px;margin:12vh auto;background:white;padding:40px;border-radius:16px;box-shadow:0 20px 60px #19354612}.login .brand{color:#263940;margin-bottom:30px}.login button{width:100%}.login .note{margin-top:15px}dialog{border:0;border-radius:14px;box-shadow:0 20px 100px #10283344;padding:28px;width:min(650px,95vw);max-height:90vh}dialog::backdrop{background:#16272d88}dialog h2{margin-right:30px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#243942;color:white;padding:13px 24px;border-radius:9px;max-width:90vw;box-shadow:0 8px 28px #152b3d33;display:none;z-index:20}#toast.error{background:#a02b39}.catalog-row td{padding:12px 10px}.catalog-row.selected{background:#fff8f8}.catalog-footer{position:sticky;bottom:0;padding:15px;background:white;border-top:1px solid #e1e7ea;display:flex;justify-content:space-between}.divider{height:1px;background:#e5ebee;margin:20px 0}.nowrap{white-space:nowrap}a{color:#c52230}footer{font-size:11px;color:#93a0a8;margin-top:25px}.wide{grid-column:1/-1}.compact{font-size:12px}.terminalinfo{font-size:11px;color:#819098}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e8a3a8;outline-offset:2px}@media(max-width:1100px){.app{grid-template-columns:180px 1fr}.sidebar{padding:25px 15px}.workspace{padding:28px 22px}.grid2{grid-template-columns:1fr}.metrics{gap:10px}.metric{padding:16px}.metric b{font-size:22px}}@media(max-width:720px){.app{display:block}.sidebar{height:auto;position:static;padding:16px}.sidebar .brand{font-size:22px}.sidebar small,.sidebar .bottom{display:none}.nav{margin:15px 0 0;display:flex;flex-wrap:wrap;gap:4px}.nav button{padding:7px 12px}.workspace{padding:22px 14px}.metrics{grid-template-columns:repeat(2,1fr)}.topbar{align-items:flex-start}.topbar h1{font-size:25px}.card{padding:16px}.formgrid{grid-template-columns:1fr}.bar{gap:8px}dialog{padding:20px}}

body{font-size:16px}label,.compact,.event,.note,.demo{font-size:14px}.badge,.steps span,td small,th,.terminalinfo{font-size:12px}.metric span{font-size:14px}

.help-guide{border-bottom:1px solid #dce3e7;padding:16px 0}.help-guide summary{cursor:pointer;font-weight:700}.help-guide li{margin:12px 0;line-height:1.6}.help-answer{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;margin-top:24px}.help-error{color:#b42318}

/* Staff workspace is embedded in ERP; ERP owns the session and return control. */
html[data-erp-staff] .sidebar .brand {display:none;}
html[data-erp-staff] .workspace {min-width:0;}

/* Public dealer entry, shared order layout retains existing responsive rules. */
.public-login{max-width:540px;width:calc(100% - 32px);margin:clamp(24px,7vh,90px) auto;padding:clamp(24px,5vw,48px);box-sizing:border-box}
.public-login .brand{margin-bottom:38px}.public-login h1{font-size:clamp(28px,5vw,38px);line-height:1.15;margin:10px 0 18px}
.public-login .eyebrow{font-size:12px;letter-spacing:.12em}.public-login .muted{line-height:1.65}
.public-login label{display:block;margin:24px 0 8px}.key-entry{display:flex;align-items:stretch;gap:8px;min-width:0}
.key-entry input{flex:1;min-width:0;font-size:16px;margin:0}.key-entry button{flex:none;font-size:14px;padding:12px;min-height:48px}
.public-enter{width:100%;margin:16px 0 24px;min-height:50px}.public-login .note{font-size:14px;line-height:1.6;margin-top:8px}
.public-hint{font-size:13px;margin-top:20px}.public-login :focus-visible{outline:3px solid #2463eb;outline-offset:3px}
@media(max-width:420px){.public-login{width:calc(100% - 24px);padding:24px 20px;margin:20px auto}.public-login .brand{margin-bottom:28px}.key-entry{gap:6px}.key-entry button{padding:10px 8px}}

/* 1.0.1: keep the key field usable despite the shared .login button width. */
.public-login .key-entry{display:grid;grid-template-columns:minmax(0,1fr) auto}
.public-login .key-entry input{width:100%;min-width:0}
.public-login .key-entry button{width:auto;min-width:88px;white-space:nowrap}

/* Photo viewer 1.0.0: originals stay in the authenticated session. */
.photos .photo-thumb{padding:0;border:0;background:transparent;line-height:0;border-radius:7px}
.photos .photo-thumb img{display:block}
#photo-viewer{padding:0;width:min(1440px,96vw);height:92vh;height:92dvh;max-height:96vh;max-height:96dvh;max-width:96vw;margin:auto;overflow:hidden;background:#fff;color:#19242a}
#photo-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
#photo-viewer::backdrop{background:#101a24d9}
#photo-viewer .photo-preview-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid #e1e7ea}
#photo-viewer h2{margin:0;font-size:18px;line-height:1.35;overflow-wrap:anywhere;min-width:0}
#photo-viewer .photo-preview-header button{flex:none;min-height:44px}
#photo-viewer .photo-preview-stage{min-width:0;min-height:0;display:grid;place-items:center;overflow:auto;background:#17242b}
#photo-viewer #photo-preview-image{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain}
#photo-viewer #photo-preview-image[hidden],#photo-viewer [hidden]{display:none}
#photo-viewer #photo-preview-status{color:#fff;padding:24px;max-width:580px;text-align:center;line-height:1.6}
#photo-viewer .photo-preview-footer{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:12px;padding:14px 20px;margin:0;border-top:1px solid #e1e7ea}
#photo-viewer .photo-preview-footer button{min-height:44px}
#photo-viewer button:focus-visible{outline:3px solid #2463eb;outline-offset:2px}
@media(max-width:600px){
 #photo-viewer{width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;border-radius:0}
 #photo-viewer .photo-preview-header{padding:calc(12px + env(safe-area-inset-top,0px)) 12px 12px;gap:12px}
 #photo-viewer h2{font-size:16px}
 #photo-viewer .photo-preview-footer{padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px))}
 #photo-viewer .photo-preview-footer button{flex:1;white-space:normal}
}

/* Read-only shipment information in the dealer order. */
.cargo-summary,.cargo-handover{background:#f4f7f8;border:1px solid #dce5e9;border-radius:14px;padding:18px;margin:18px 0;min-width:0}
.cargo-summary h3,.cargo-handover h3{font-size:17px;margin:0 0 14px;line-height:1.4}
.cargo-values{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cargo-values>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.cargo-values span,.cargo-handover span{font-size:13px;color:#526775}
.cargo-values strong{font-size:23px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.cargo-missing{color:#8a5708;font-size:13px;line-height:1.5}
.cargo-basis{font-size:12px;color:#526775;line-height:1.5;margin:14px 0 0}
.cargo-handover p{margin:10px 0;overflow-wrap:anywhere}
.cargo-handover p span,.cargo-handover p strong{display:block;line-height:1.5}
@media(max-width:560px){.cargo-values{grid-template-columns:1fr}.cargo-summary,.cargo-handover{padding:14px}.cargo-values strong{font-size:21px}}

/* Delivery form: one scroll region, persistent title and action on tablet/mobile. */
.delivery-form label{font-size:14px;color:#52616b;margin-bottom:14px}
.delivery-form input,.delivery-form select{font-size:16px;min-height:46px;min-width:0;box-sizing:border-box}
.delivery-form .formgrid>*{min-width:0}
.delivery-hint{font-size:13px;color:#60717c;line-height:1.45;margin:8px 0 0}
.delivery-suggestions:empty{display:none}
.delivery-suggestions{display:grid;gap:4px;max-height:180px;overflow-y:auto;margin:-5px 0 16px;font-size:13px;line-height:1.4;color:#60717c;overscroll-behavior:contain}
.delivery-suggestions button{width:100%;text-align:left;border:1px solid #e1e6eb;border-radius:7px;padding:10px 12px;min-height:44px;background:#f7f9fa;color:#21313a;white-space:normal;overflow-wrap:anywhere}
.delivery-suggestions button:hover,.delivery-suggestions button:focus-visible{background:#edf5f3;border-color:#16816b}
dialog.delivery-modal{padding:0;width:min(720px,calc(100vw - 32px));max-width:none;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:hidden;margin:auto}
.delivery-modal #modal-body{min-height:0}
.delivery-modal #dialog-form{display:flex;flex-direction:column;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);margin:0}
.delivery-modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:20px 24px 16px;border-bottom:1px solid #e5e9ed;background:#fff}
.delivery-modal-header h2{font-size:22px;line-height:1.25;margin:0}
.delivery-modal-header button{font-size:25px;min-width:44px;min-height:44px;padding:0;border:0;color:#61737d}
.delivery-modal-content{padding:20px 24px;overflow-y:auto;overscroll-behavior:contain;min-height:0;-webkit-overflow-scrolling:touch}
.delivery-modal-content>.note{font-size:13px;line-height:1.4;margin:0 0 18px;padding:12px 14px}
.delivery-modal-footer.actions{flex:none;margin:0;padding:16px 24px max(16px,env(safe-area-inset-bottom));border-top:1px solid #e5e9ed;background:#fff}
.delivery-modal-footer button{min-height:46px;font-size:15px}
@media(max-width:560px){dialog.delivery-modal{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.delivery-modal #dialog-form{max-height:calc(100dvh - 16px)}.delivery-modal-header,.delivery-modal-content,.delivery-modal-footer.actions{padding-left:16px;padding-right:16px}.delivery-modal-header h2{font-size:20px}.delivery-form .formgrid{grid-template-columns:1fr;gap:0}.delivery-modal-footer .primary{flex:1}.delivery-modal-footer button{padding:10px 12px}}

/* Constrain native Safari date controls to their grid cell. */
.delivery-form input[type="date"]{display:block;inline-size:100%;max-inline-size:100%;min-inline-size:0;max-width:100%;-webkit-appearance:none;appearance:none}
.delivery-form input[type="date"]::-webkit-date-and-time-value{text-align:left;min-width:0}
.delivery-form .formgrid>label{max-width:100%;overflow-wrap:anywhere}
.delivery-location-message{margin:4px 0 6px;line-height:1.45;font-size:13px;color:#52616b}
