:root{--bg:#f4f6f8;--card:#fff;--text:#20262e;--muted:#69717d;--brand:#1367d1;--line:#dfe4ea;--ok:#15803d;--warn:#b45309;--danger:#c62828;--danger-bg:#fff0f0}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Arial,Helvetica,sans-serif}.container{max-width:1250px;margin:28px auto;padding:0 18px}.topbar,.page-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px}.topbar h1{margin:0;font-size:27px}.topbar h1 span{font-size:15px;background:#e5eefb;color:var(--brand);padding:4px 7px;border-radius:6px}.topbar p,.page-head p{margin:5px 0 0;color:var(--muted)}.page-head h2{margin:0}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.03)}h2{margin-top:0}.muted{color:var(--muted)}.small{font-size:13px}textarea,input,select{width:100%;border:1px solid #cbd2da;border-radius:7px;padding:9px;font:inherit;background:#fff}textarea{resize:vertical}.primary,.secondary{border:0;border-radius:8px;padding:11px 16px;font-weight:700;text-decoration:none;display:inline-block;cursor:pointer}.primary{background:var(--brand);color:#fff}.secondary{background:#e9edf2;color:#27313d}.actions{display:flex;gap:8px;flex-wrap:wrap}.foot{text-align:center;color:var(--muted);font-size:13px}.summary{display:flex;justify-content:space-between;gap:12px;align-items:center}.summary span{color:var(--muted)}.alert{padding:12px;border-radius:8px;margin:10px 0}.alert.red{background:#feecec;color:var(--danger)}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px 18px}.receiver-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.f label{display:block;font-size:12px;font-weight:700;color:#555f6b;margin-bottom:5px}.wide2{grid-column:span 6}.record{padding:0;overflow:hidden}.record-head{display:flex;align-items:center;gap:16px;padding:11px 18px;background:#fafbfc;border-bottom:1px solid var(--line)}.check{font-weight:700}.receiver-title{flex:1}.status{font-weight:700;font-size:13px;padding:6px 9px;border-radius:20px}.status.ready{color:var(--ok);background:#eaf7ee}.status.warn{color:var(--danger);background:#feecec}.field-error label,.field-error>span{color:var(--danger)!important}.field-error input,.field-error textarea{border:2px solid var(--danger)!important;background:var(--danger-bg)!important}.sender-group{margin:20px 0 26px}.sender-head{display:flex;justify-content:space-between;align-items:center;padding:0 4px 8px}.sender-head h3{margin:0;font-size:18px}.sender-head p{margin:4px 0 0;color:var(--muted);font-size:13px}.batch-badge{background:#e9edf2;border-radius:20px;padding:6px 10px;font-size:12px;font-weight:700}.empty{text-align:center;color:var(--muted);padding:32px}.parcel-compact{display:flex;align-items:flex-end;gap:6px;padding:8px 18px;border-top:1px solid #edf0f3;background:#fcfcfd;flex-wrap:wrap}.parcel-label{font-size:12px;font-weight:800;color:#3c4652;align-self:center;margin-right:2px}.compact-field{display:flex;flex-direction:column;gap:3px;min-width:66px}.compact-field>span{font-size:11px;font-weight:700;color:#66707c}.compact-field input,.compact-field textarea{padding:5px 6px;font-size:13px}.compact-input{display:flex;align-items:center;gap:3px}.compact-input input{width:56px}.compact-input em{font-size:11px;color:#717a85;font-style:normal}.times{color:#8b929b;padding-bottom:6px}.size-label{font-size:11px;font-weight:700;color:#66707c;padding-bottom:7px;margin-left:2px}.item-field{min-width:140px;flex:1;max-width:220px}.courier-box{margin:0 18px 12px;border:1px solid #d8e4f4;background:#f7fbff;border-radius:9px;padding:10px 14px}.courier-box>p{margin:5px 0 8px}.lineclear-row{display:flex;gap:10px;align-items:flex-end}.unit-field{width:230px}.lc-address{flex:1}.smallbtn{padding:8px 12px;font-size:13px;white-space:nowrap}details{border-top:1px solid #edf0f3;padding:10px 18px 13px;color:var(--muted)}pre{white-space:pre-wrap;background:#f6f7f9;padding:12px;border-radius:7px;color:#333}.history-tools{display:flex;gap:8px}.history-wrap{overflow-x:auto}.history-table{width:100%;border-collapse:collapse;font-size:13px}.history-table th,.history-table td{padding:10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.history-table th{background:#fafbfc;white-space:nowrap}.history-table td:last-child{min-width:300px}.modal{position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:50;align-items:flex-start;justify-content:center;padding:45px 18px;overflow:auto}.modal-card{background:#fff;width:min(900px,100%);border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.18);padding:20px}.modal-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start}.modal-head h2{margin-bottom:4px}.modal-head p{margin:0}.iconbtn{border:0;background:#eef1f4;border-radius:8px;width:36px;height:36px;font-size:25px;line-height:30px;cursor:pointer}.tabs{display:flex;gap:7px;border-bottom:1px solid var(--line);margin:18px 0 12px;padding-bottom:10px;flex-wrap:wrap}.tab{border:0;background:#eef1f4;padding:8px 12px;border-radius:7px;cursor:pointer;font-weight:700}.tab.active{background:var(--brand);color:#fff}.default-section{padding:5px 0 10px}.default-section h3{font-size:15px;margin:8px 0 10px}.defaults-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.default-field{display:flex;flex-direction:column;gap:4px}.default-field>span{font-size:12px;font-weight:700;color:#555f6b}.default-field small{font-size:11px;color:var(--muted)}.modal-actions{display:flex;gap:8px;border-top:1px solid var(--line);padding-top:15px;margin-top:8px}.spacer{flex:1}
@media(max-width:900px){.receiver-grid,.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.wide2{grid-column:span 2}.topbar,.summary,.page-head{align-items:flex-start;flex-direction:column}.record-head{flex-wrap:wrap}.status{width:100%}.defaults-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.lineclear-row{flex-direction:column;align-items:stretch}.unit-field{width:auto}.parcel-compact{align-items:flex-end}.history-tools{flex-direction:column}}
.brandline{display:grid;grid-template-columns:auto auto;align-items:center;gap:8px 10px}.brandline p{grid-column:1/3}.compact-nav{padding:7px 10px;font-size:12px}.main-nav .secondary{min-width:100px}.sender-group{border:1px solid var(--line);border-radius:13px;padding:12px 12px 2px}.sender-group.shade-0{background:#f8fbff}.sender-group.shade-1{background:#fbfaf6}.sender-title-row{display:flex;align-items:center;gap:10px}.sender-select{width:18px;height:18px;accent-color:var(--brand)}.bottom-export{display:flex;justify-content:flex-end;padding:8px 0 30px}.dhl-row{display:flex;align-items:end;gap:14px;margin-top:8px}.dhl-row select{min-width:100px;padding:6px}.dhl-box{background:#fffaf2}

.chargeable-field{display:flex;flex-direction:column;gap:3px;min-width:92px;padding:0 5px 1px}.chargeable-field>span{font-size:11px;font-weight:700;color:#66707c}.chargeable-field strong{font-size:14px;color:var(--danger);white-space:nowrap}.chargeable-field small{font-size:10px;color:#7b8490;white-space:nowrap}
.receiver-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:10px}.or-sep{color:var(--muted);font-size:12px}.photo-picker{display:inline-flex;align-items:center}.photo-picker input{position:absolute;left:-9999px}.photo-picker span{display:inline-block;background:#eef1f4;color:#27313d;border-radius:8px;padding:10px 13px;font-weight:700;cursor:pointer}.secondary.mini{padding:8px 11px;font-size:12px}.photo-status{margin-top:8px;min-height:18px}.narrow-modal{width:min(650px,100%)}.photo-setup-grid{display:grid;grid-template-columns:1fr;gap:11px;margin:18px 0}.delete-row{border:1px solid #e5bcbc;background:#fff4f4;color:var(--danger);border-radius:7px;padding:6px 9px;font-weight:700;cursor:pointer;font-size:12px}.delete-row:hover{background:#ffe7e7}

/* V15: photo recognition is temporarily hidden from the New Order UI. */
.photo-feature-hidden{display:none !important}

/* V16 bulk update controls */
.bulk-update{margin:12px 0 16px}.bulk-title{display:flex;align-items:baseline;gap:12px;margin-bottom:10px}.bulk-grid{display:grid;grid-template-columns:minmax(150px,1.2fr) auto minmax(150px,1.2fr) auto;gap:8px 10px;align-items:end}.bulk-grid label,.bulk-size label{display:flex;flex-direction:column;gap:4px}.bulk-grid label>span,.bulk-size label>span{font-size:12px;color:#64748b}.bulk-grid input,.bulk-grid select{min-height:36px}.bulk-size{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}@media(max-width:850px){.bulk-grid{grid-template-columns:1fr auto}.bulk-title{align-items:flex-start;flex-direction:column;gap:3px}}

/* V17 professional MBE-inspired interface refresh. Cosmetic only. */
:root{
  --bg:#f3f4f6;--card:#ffffff;--text:#171717;--muted:#6b7280;
  --brand:#111111;--brand-soft:#262626;--line:#e5e7eb;
  --ok:#15803d;--ok-bg:#ecfdf3;--warn:#b45309;
  --danger:#c62828;--danger-bg:#fff1f2;--green-soft:#ecfdf3;--green-line:#86d7a4;
}
body{background:linear-gradient(180deg,#eceff2 0,#f6f7f8 220px);font-family:Inter,"Segoe UI",Arial,Helvetica,sans-serif;letter-spacing:.005em}
.container{max-width:1320px;margin:0 auto;padding:22px 22px 42px}
.topbar{background:#111;color:#fff;margin:0 -22px 24px;padding:16px 22px;border-bottom:3px solid #2f2f2f;box-shadow:0 4px 18px rgba(0,0,0,.12);position:sticky;top:0;z-index:20}
.brandline{gap:7px 10px}.topbar h1{font-size:23px;font-weight:800;letter-spacing:-.025em}.topbar h1 span{background:#fff;color:#111;border-radius:999px;font-size:11px;padding:4px 8px;vertical-align:3px}.topbar p{color:#aeb4bd;font-size:12px;margin-top:1px}
.topbar .secondary{background:#27272a;color:#f9fafb;border:1px solid #444;border-radius:7px;box-shadow:none}.topbar .secondary:hover{background:#3f3f46;border-color:#5b5b62}.topbar .main-nav .secondary{min-width:104px}.topbar .main-nav .secondary:focus{outline:2px solid #fff;outline-offset:2px}
.card{border:1px solid #e1e4e8;border-radius:10px;box-shadow:0 2px 8px rgba(15,23,42,.045);padding:20px}.card h2{font-size:19px;letter-spacing:-.015em}.page-head h2{font-size:22px;letter-spacing:-.02em}
textarea,input,select{border:1px solid #cfd4da;border-radius:6px;padding:8px 9px;transition:border-color .15s,box-shadow .15s,background .15s}textarea:focus,input:focus,select:focus{outline:none;border-color:#737b85;box-shadow:0 0 0 3px rgba(17,24,39,.08)}
.primary,.secondary{border-radius:7px}.primary{background:#111;color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.15)}.primary:hover{background:#292929}.secondary{background:#f0f1f2;color:#222;border:1px solid #e0e2e5}.secondary:hover{background:#e5e7e9}
.sender-group{border:1px solid #dfe3e7;border-radius:12px;padding:14px 14px 4px;box-shadow:0 2px 10px rgba(15,23,42,.035)}.sender-group.shade-0{background:#f8fafb}.sender-group.shade-1{background:#f1f3f5}.sender-head{padding:1px 4px 10px}.sender-head h3{font-size:17px}.batch-badge{background:#fff;border:1px solid #dde1e5;color:#4b5563}
.record{border-radius:9px;box-shadow:0 1px 5px rgba(15,23,42,.04)}.record-head{background:#fafafa;padding:10px 16px}.receiver-title strong{font-size:14px}.status{border:1px solid transparent}.status.ready{color:#14743a;background:var(--ok-bg);border-color:#c7eed5}.status.warn{color:#b42318;background:#fff1f1;border-color:#f5c2c0}
.check input,.sender-select{accent-color:#111}.delete-row{background:#fff;color:#b42318;border-color:#efc5c2}.delete-row:hover{background:#fff0f0}
.receiver-grid{gap:9px 10px;padding:13px 16px}.f label{font-size:11px;text-transform:uppercase;letter-spacing:.045em;color:#606873}.wide2 textarea{min-height:58px}
/* Courier is an operational focus: green makes it easy to spot while scanning. */
.courier-field label{color:#13713a}.courier-select{background:var(--green-soft);border:1px solid var(--green-line);color:#116530;font-weight:800}.courier-select:focus{border-color:#2ca35c;box-shadow:0 0 0 3px rgba(34,197,94,.13)}
.parcel-compact{padding:8px 16px;background:#fbfbfc;gap:5px;border-top:1px solid #eceff1}.parcel-label{background:#222;color:#fff;padding:4px 7px;border-radius:5px;font-size:10px;letter-spacing:.04em}.compact-field>span,.size-label{font-size:10px;text-transform:uppercase;letter-spacing:.035em}.compact-field input,.compact-field textarea{padding:5px 6px}.chargeable-field{border-left:1px solid #e3e5e8;margin-left:4px;padding-left:10px}.chargeable-field strong{font-weight:800}
.bulk-update{background:#fff;border:1px solid #dfe3e7;border-radius:10px;box-shadow:0 2px 8px rgba(15,23,42,.04)}.bulk-title strong{font-size:15px}.bulk-grid label>span,.bulk-size label>span{font-weight:700;color:#59616b}
.courier-box{border-color:#dfe4e8;background:#f8fafb}.dhl-box{background:#fffdf7}.address-check{background:#f7faf8}
.history-table{background:#fff;border:1px solid #e2e5e8;border-radius:9px;overflow:hidden}.history-table th{background:#161616;color:#fff;font-size:11px;text-transform:uppercase;letter-spacing:.045em}.history-table td{background:#fff}.history-table tbody tr:hover td{background:#f8f9fa}
.modal{background:rgba(0,0,0,.56);backdrop-filter:blur(2px)}.modal-card{border-radius:11px;border:1px solid #333}.modal-head{border-bottom:1px solid #eceef0;padding-bottom:12px}.tab{background:#f0f1f2}.tab.active{background:#111;color:#fff}.iconbtn{background:#eee;color:#222}
.field-error input,.field-error textarea,.field-error select{border:2px solid var(--danger)!important;background:var(--danger-bg)!important;box-shadow:0 0 0 2px rgba(198,40,40,.05)}
.foot{padding-top:8px;color:#8a919a}
@media(max-width:900px){.topbar{position:static;margin:0 -18px 18px;padding:15px 18px}.container{padding:0 18px 32px}.main-nav{width:100%}.main-nav .secondary{flex:1}.courier-field{order:-1}}

/* V18 commercial blue interface refresh. Cosmetic/layout only; operational logic unchanged. */
:root{
  --bg:#f3f7fc;--card:#ffffff;--text:#132238;--muted:#64748b;
  --brand:#0b3f86;--brand-soft:#1559ad;--brand-mid:#1f6fd1;--line:#dce5f0;
  --ok:#15803d;--ok-bg:#ecfdf3;--warn:#b45309;
  --danger:#d12a2a;--danger-bg:#fff3f3;--green-soft:#ebfbf1;--green-line:#7fd49c;
}
body{background:linear-gradient(180deg,#eef4fb 0,#f8fbfe 260px);color:var(--text)}
.container{max-width:1380px;padding:14px 20px 34px}
.topbar{
  background:linear-gradient(120deg,#082f68 0%,#0a438d 55%,#0c4b9d 100%);
  color:#fff;margin:0 0 18px;padding:13px 18px;border:0;border-radius:14px;
  box-shadow:0 6px 18px rgba(10,63,134,.18);position:sticky;top:8px;z-index:20;
}
.brandline{display:flex;flex-direction:column;align-items:flex-start;gap:1px}.brandline p{grid-column:auto}
.topbar h1{font-size:22px;font-weight:800;letter-spacing:-.025em}.topbar h1 span{background:#e7f0ff;color:#0b4a98;border-radius:999px;font-size:10px;padding:4px 7px;vertical-align:3px}
.topbar p{color:#d7e7fb;font-size:11px;margin:0}
.topbar .main-nav{gap:6px}.topbar .secondary.nav-btn{background:transparent;color:#e9f2ff;border:1px solid rgba(255,255,255,.12);border-radius:9px;min-width:104px;padding:9px 12px;box-shadow:none}
.topbar .secondary.nav-btn:hover{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.22)}
.topbar .secondary.nav-btn.active{background:#1f6fd1;color:#fff;border-color:#4d91e1;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.topbar .secondary.nav-btn:focus{outline:2px solid #a8ccff;outline-offset:2px}
.card{border:1px solid #dce5ef;border-radius:11px;box-shadow:0 2px 7px rgba(28,64,104,.045);padding:17px}.card h2{font-size:18px}.page-head{margin-bottom:11px}.page-head h2{font-size:21px}.page-head p{font-size:12px}
.primary{background:#0b4a98;color:#fff;box-shadow:0 1px 2px rgba(8,47,104,.18)}.primary:hover{background:#083b7d}.secondary{background:#edf3fa;color:#174477;border:1px solid #d8e4f1}.secondary:hover{background:#e1ebf7}
textarea,input,select{border-color:#cad7e5;border-radius:7px;padding:7px 8px}textarea:focus,input:focus,select:focus{border-color:#4e8dd3;box-shadow:0 0 0 3px rgba(31,111,209,.11)}
/* Dense standby layout: keep addresses prominent while fitting more customers on screen. */
.sender-group{margin:12px 0 16px;border-color:#d9e4f0;border-radius:12px;padding:9px 10px 2px;box-shadow:0 2px 8px rgba(28,64,104,.035)}
.sender-group.shade-0{background:#f8fbff}.sender-group.shade-1{background:#f3f7fc}.sender-head{padding:0 3px 6px}.sender-head h3{font-size:16px}.sender-head p{font-size:11px;margin-top:2px}.batch-badge{padding:4px 8px;font-size:11px}
.record{border-radius:9px;margin-bottom:9px}.record-head{padding:7px 12px;background:#fbfdff;gap:12px}.receiver-title strong{font-size:16px;font-weight:700;color:#10233e}.receiver-title{font-size:13px}.check{font-size:13px}.status{font-size:11px;padding:4px 7px}.delete-row{padding:5px 8px;font-size:11px}
.receiver-grid{gap:6px 9px;padding:9px 12px}.f label{font-size:10px;margin-bottom:3px}.receiver-grid input,.receiver-grid select{height:36px;padding:6px 8px}.wide2 textarea{min-height:46px;max-height:58px;padding:7px 8px}
.parcel-compact{padding:6px 12px;gap:4px;background:#f9fbfe}.parcel-label{padding:4px 7px}.compact-field{gap:2px}.compact-field>span,.size-label{font-size:9px}.compact-field input,.compact-field textarea{padding:4px 5px;height:30px}.compact-input input{width:54px}.times{padding-bottom:4px}.size-label{padding-bottom:5px}.item-field{max-width:240px}.chargeable-field{min-width:88px;padding-left:8px;margin-left:3px}.chargeable-field>span{font-size:9px}.chargeable-field strong{font-size:13px}.chargeable-field small{font-size:9px}
details{padding:7px 12px 8px;font-size:12px}pre{padding:8px;margin:7px 0 0;font-size:11px}
.courier-select{background:var(--green-soft);border-color:var(--green-line);color:#0a6a32}.courier-field label{color:#0d7738}
.bulk-update{margin:8px 0 11px;padding:12px}.bulk-title{margin-bottom:7px}.bulk-grid{gap:6px 8px}.bulk-grid input,.bulk-grid select{min-height:32px;height:32px;padding:5px 7px}.bulk-grid .secondary{padding:7px 10px}
.summary.card{padding:11px 14px;margin-bottom:10px}.bottom-export{padding:4px 0 22px}.history-tools{padding:12px}.history-wrap{padding:0}.history-table th,.history-table td{padding:8px 9px}.history-table th{background:#0b3f86}.tabs .tab.active{background:#0b4a98}.modal-card{border:1px solid #cbd9e9;border-radius:13px}.iconbtn{background:#edf3fa;color:#164a82}
@media(max-width:900px){.topbar{position:static;margin:0 0 14px;padding:12px 14px;border-radius:12px}.container{padding:10px 12px 28px}.main-nav{width:100%}.main-nav .secondary.nav-btn{flex:1;min-width:calc(50% - 6px)}.receiver-title strong{font-size:15px}.receiver-grid{padding:9px 10px}.wide2 textarea{max-height:none}}

/* V19: simple external AI Help navigation link */
.main-nav .nav-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:nowrap}
.main-nav .nav-link:hover{text-decoration:none}

/* V20 Courier Tools */
.tools-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:14px}
.tool-card{display:grid;grid-template-columns:48px 1fr;gap:6px 14px;align-items:start;padding:20px}
.tool-card .f{grid-column:1/-1;margin-top:8px}
.tool-card .f span{display:block;font-weight:700;color:#17345f;margin-bottom:7px}
.tool-card textarea{min-height:118px;resize:vertical}
.tool-icon{width:44px;height:44px;border-radius:14px;background:#e9f1ff;color:#174ea6;display:flex;align-items:center;justify-content:center;font-size:23px;font-weight:800}
.tool-copy h3{margin:1px 0 5px;font-size:18px;color:#102a4c}
.tool-copy p{margin:0}
.tool-action{grid-column:1/-1;justify-self:start;margin-top:6px}
.tool-note{margin-top:16px;display:flex;gap:12px;align-items:center;padding:14px 16px;background:#f6f9ff}
.tool-note strong{color:#17345f;white-space:nowrap}
.tool-note span{color:#64748b}
@media(max-width:760px){.tools-grid{grid-template-columns:1fr}.tool-note{align-items:flex-start;flex-direction:column;gap:4px}}

/* V21 — Easy Mail Management System (EMMS) workflow additions */
.date-sent-field input{font-weight:700;color:#103f78;background:#f7fbff}
.processing-overlay{position:fixed;inset:0;z-index:80;background:rgba(9,30,66,.44);backdrop-filter:blur(3px);align-items:center;justify-content:center;padding:20px}
.processing-card{width:min(420px,94vw);background:#fff;border:1px solid #cbd9e9;border-radius:16px;padding:25px 28px;text-align:center;box-shadow:0 24px 70px rgba(8,47,104,.24)}
.processing-card h2{margin:8px 0 18px;color:#10345f}.processing-spinner{width:30px;height:30px;margin:0 auto;border:3px solid #dce9f8;border-top-color:#1f6fd1;border-radius:50%;animation:emms-spin .8s linear infinite}
@keyframes emms-spin{to{transform:rotate(360deg)}}
.progress-track{height:12px;background:#e9f0f8;border-radius:999px;overflow:hidden}.progress-bar{height:100%;width:0;background:linear-gradient(90deg,#1559ad,#2c7bd8);transition:width .18s ease;border-radius:999px}.progress-percent{font-size:25px;font-weight:800;color:#0b4a98;margin:12px 0 2px}.processing-card p{margin:0}
.history-notice{margin:0 0 10px;padding:11px 14px;border:1px solid #add7bd;border-radius:9px;background:#effbf3;color:#126b36;font-weight:700}
.emms-history{min-width:1320px}.emms-history th,.emms-history td{vertical-align:middle}.emms-history td:nth-child(5){min-width:300px;max-width:430px}.emms-history td:last-child{min-width:110px}.history-input{min-width:130px;height:34px;padding:5px 7px;font-size:12px}.history-input[type="date"]{min-width:132px}.history-input.saving{background:#fff8dc;border-color:#e3b341}.history-courier{display:inline-block;padding:5px 8px;border-radius:7px;background:#ebfbf1;border:1px solid #9dddb4;color:#0a6a32;font-weight:800;white-space:nowrap}.manual-tag{display:block;margin-top:4px;color:#64748b;font-size:10px}.history-new td{animation:emms-newrow 4s ease-out}@keyframes emms-newrow{0%,45%{background:#e8f2ff}100%{background:#fff}}
.manual-modal{width:min(880px,100%)}.manual-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:18px 0 8px}.manual-address{grid-column:span 3}.manual-address textarea{min-height:82px}
@media(max-width:760px){.manual-grid{grid-template-columns:1fr}.manual-address{grid-column:span 1}.processing-card{padding:22px 18px}.emms-history{min-width:1180px}}

/* V22 — Completed records grouped by Date Sent + Sender */
.completed-bulk{margin-bottom:14px;padding:12px 14px}.completed-bulk-grid{display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(180px,1fr) auto auto;gap:8px;align-items:end}.completed-bulk-grid label span{display:block;font-size:10px;font-weight:800;color:#52657b;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}.completed-bulk-grid input{height:34px}.history-export-btn{height:34px;white-space:nowrap}
.completed-date-group{margin:0 0 20px}.completed-date-head{display:flex;align-items:center;justify-content:space-between;padding:9px 12px;margin-bottom:8px;border-radius:9px;background:#0b3f86;color:#fff;box-shadow:0 2px 6px rgba(11,63,134,.12)}.completed-date-head strong{font-size:15px}.completed-date-head span{font-size:11px;color:#dcecff}
.completed-sender-group{border:1px solid #dce5ef;border-radius:11px;background:#fff;margin:0 0 11px;overflow:hidden;box-shadow:0 2px 7px rgba(28,64,104,.04)}.completed-sender-head{display:flex;align-items:center;justify-content:space-between;padding:8px 11px;background:#f5f9fe;border-bottom:1px solid #e3ebf4}.completed-sender-select{display:flex;align-items:center;gap:8px;font-weight:800;color:#163d6a}.completed-sender-select input{width:16px;height:16px;margin:0}.completed-sender-select span{font-size:14px}.completed-sender-group .history-wrap{border:0;border-radius:0;box-shadow:none;padding:0;overflow-x:auto}.grouped-history{min-width:1280px;border:0;border-radius:0}.grouped-history th{background:#eaf1f9;color:#23476f;border-bottom:1px solid #d7e2ef}.grouped-history td{padding:7px 8px}.grouped-history th:first-child,.grouped-history td:first-child{width:36px;text-align:center}.history-check-cell input{width:15px;height:15px}.grouped-history .history-address{min-width:300px;max-width:450px}.grouped-history .ma-weight-input{min-width:78px;width:82px}.grouped-history td:nth-child(5){white-space:nowrap}.grouped-history .history-input{height:32px;min-width:116px}.grouped-history td:nth-child(7) .history-input{min-width:170px}.grouped-history td:nth-child(8) .history-input,.grouped-history td:nth-child(9) .history-input{min-width:145px}
@media(max-width:980px){.completed-bulk-grid{grid-template-columns:1fr auto;}.history-export-btn{grid-column:1/-1}.grouped-history{min-width:1180px}}

/* V24 — tracking import fix + Completed record delete */
.same-sender-check{display:flex;align-items:center;gap:6px;margin:3px 18px 10px;padding:10px 12px;border-radius:9px;background:#f2f7fd;color:#183d69;font-size:13px}.same-sender-check input{width:17px;height:17px}.same-sender-check span{color:#64748b}.sender-details-panel{margin:8px 18px 3px;border:1px solid #cfdceb;border-radius:10px;background:#f9fbfe}.sender-panel-head{display:flex;gap:10px;align-items:baseline;padding:10px 14px 0;color:#174477}.customer-name-wrap{position:relative}.customer-suggestions{position:absolute;left:0;right:0;top:100%;z-index:35;background:#fff;border:1px solid #b9cce2;border-radius:8px;box-shadow:0 10px 24px rgba(19,55,95,.16);overflow:hidden;margin-top:3px}.customer-suggestions button{display:flex;width:100%;justify-content:space-between;gap:10px;border:0;border-bottom:1px solid #edf2f7;background:#fff;padding:9px 10px;text-align:left;cursor:pointer;color:#163d6a}.customer-suggestions button:hover{background:#edf5ff}.customer-suggestions button span{color:#64748b;font-size:12px}.customer-suggestions button:last-child{border-bottom:0}

/* Completed should fit a normal desktop without horizontal scrolling. */
.completed-sender-group .history-wrap{overflow-x:hidden}.grouped-history,.emms-history{min-width:0!important;width:100%;table-layout:fixed}.grouped-history th,.grouped-history td{padding:6px 5px;font-size:11px;overflow-wrap:anywhere}.grouped-history th:nth-child(1){width:3%}.grouped-history th:nth-child(2){width:12%}.grouped-history th:nth-child(3){width:10%}.grouped-history th:nth-child(4){width:27%}.grouped-history th:nth-child(5){width:5%}.grouped-history th:nth-child(6){width:6%}.grouped-history th:nth-child(7){width:13%}.grouped-history th:nth-child(8){width:10%}.grouped-history th:nth-child(9){width:8%}.grouped-history th:nth-child(10){width:7%}.grouped-history .history-address{min-width:0!important;max-width:none!important;white-space:normal;line-height:1.3}.grouped-history .history-input{min-width:0!important;width:100%;height:30px;padding:4px 5px;font-size:11px}.grouped-history .ma-weight-input{min-width:0!important;width:100%}.grouped-history td:nth-child(5){white-space:nowrap}.grouped-history .history-courier{font-size:10px;padding:4px 5px;white-space:normal;text-align:center}.completed-date-head{margin-top:4px}

.customer-toolbar{display:flex;gap:8px;padding:12px}.customer-list{display:grid;gap:9px}.customer-row{display:grid;grid-template-columns:minmax(260px,1fr) minmax(320px,2fr) auto;align-items:center;gap:14px;margin:0;padding:12px 14px}.customer-row-main{display:grid;grid-template-columns:1fr;gap:2px}.customer-row-main strong{color:#123c6d;font-size:15px}.customer-row-main span{font-size:12px;color:#64748b}.customer-row-address{font-size:12px;line-height:1.4;color:#334155}.customer-edit-btn{padding:7px 11px}

.import-modal{width:min(1100px,96vw)}.import-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:16px 0 10px}.import-picker span{background:#edf3fa;color:#174477;border:1px solid #d8e4f1}.import-preview{margin-top:10px;max-height:430px;overflow:auto;border:1px solid #dce5ef;border-radius:9px}.import-preview table{width:100%;border-collapse:collapse;font-size:11px}.import-preview th,.import-preview td{padding:7px 8px;border-bottom:1px solid #e7edf4;text-align:left;vertical-align:top}.import-preview th{position:sticky;top:0;background:#eaf1f9;color:#23476f;z-index:1}.import-preview td:nth-child(6){min-width:260px}.import-bad{background:#fff5f5}.import-error{color:#b42318;font-weight:700}

@media(max-width:980px){.grouped-history{table-layout:auto;min-width:1050px!important}.completed-sender-group .history-wrap{overflow-x:auto}.customer-row{grid-template-columns:1fr}.customer-edit-btn{justify-self:start}}

/* V24 Completed row actions */
.history-courier-actions{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.history-delete{border:1px solid #efb5b5;background:#fff;color:#b42318;border-radius:5px;padding:3px 5px;font-size:9px;font-weight:700;cursor:pointer}.history-delete:hover{background:#fff1f1}.history-delete:disabled{opacity:.55;cursor:wait}

/* V25 Completed tracking controls */
.tracking-cell{display:flex;flex-direction:column;gap:5px;min-width:0}
.tracking-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:20px}
.delivered-check{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:#475569;white-space:nowrap;cursor:pointer}
.delivered-check input{margin:0;accent-color:#16a34a}
.delivered-check:has(input:checked){color:#15803d;font-weight:700}
.spx-track-link{font-size:11px;font-weight:700;color:#0b4a98;text-decoration:none;white-space:nowrap}
.spx-track-link:hover{text-decoration:underline}

/* V26 — staff authentication, admin settings, postcode confirmation */
.status.reviewed{color:#9a5b00;background:#fff7df;border:1px solid #efd48d}
.postcode-ack{display:flex;align-items:center;gap:9px;margin:0 12px 8px;padding:9px 11px;border:1px solid #efd48d;border-radius:8px;background:#fffaf0;color:#7a4b00;cursor:pointer}
.postcode-ack input{width:17px;height:17px;margin:0;accent-color:#0b4a98}.postcode-ack span{display:flex;flex-direction:column;gap:2px}.postcode-ack strong{font-size:12px}.postcode-ack small{font-size:10px;color:#80684a}
.user-chip{display:inline-flex;align-items:center;padding:6px 9px;border-radius:999px;background:rgba(255,255,255,.10);color:#dcebff;font-size:11px;font-weight:700;white-space:nowrap}.logout-btn{min-width:auto!important}
.settings-modal{width:min(980px,100%)}.settings-section-tabs{display:flex;gap:8px;margin:17px 0 12px;border-bottom:1px solid #dce5ef;padding-bottom:11px}.settings-section-btn{border:1px solid #cddbea;background:#eef4fb;color:#174477;border-radius:8px;padding:9px 18px;font-weight:800;cursor:pointer}.settings-section-btn.active{background:#0b4a98;color:#fff;border-color:#0b4a98}.staff-create-card{border:1px solid #dce5ef;border-radius:10px;background:#f8fbff;padding:14px;margin:10px 0 14px}.staff-create-card h3{margin:0 0 4px;color:#163d6a}.staff-create-card p{margin:0 0 12px}.staff-create-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:9px;align-items:end}.staff-list{display:grid;gap:8px}.staff-row{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #e1e8f0;border-radius:9px;padding:11px 12px;background:#fff}.staff-row>div:first-child{display:flex;align-items:center;gap:8px}.staff-row small{color:#64748b}.role-badge{font-size:10px;font-weight:800;text-transform:uppercase;padding:3px 6px;border-radius:999px;background:#eef2f7;color:#475569}.role-badge.admin{background:#e5efff;color:#0b4a98}.staff-actions{display:flex;gap:7px}.staff-actions .secondary{padding:7px 10px;font-size:11px}
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#062c5c,#0b4a98 50%,#f4f7fb 50%);padding:24px}.login-shell{width:min(440px,100%)}.login-brand{display:flex;align-items:center;gap:12px;color:#fff;margin:0 0 14px}.login-mark{width:60px;height:60px;border-radius:14px;background:#fff;color:#0b4a98;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:15px;box-shadow:0 8px 25px rgba(0,0,0,.15)}.login-brand h1{font-size:20px;margin:0}.login-brand p{margin:3px 0 0;color:#d7e7fb;font-size:12px}.login-card{background:#fff;border-radius:14px;padding:25px;box-shadow:0 18px 55px rgba(3,32,68,.24);border:1px solid #d8e4f1}.login-card h2{margin:0 0 5px;color:#123c6d}.login-field{display:block;margin-top:14px}.login-field span{display:block;font-size:12px;font-weight:800;color:#42566d;margin-bottom:5px}.login-field input{height:42px}.login-submit{width:100%;margin-top:18px;height:43px}.login-note{text-align:center;color:#94a3b8;font-size:11px;margin:18px 0 0}.login-success{background:#effbf3;color:#126b36}.login-card .alert{margin-top:12px}
/* Keep Customer/Sender identity fields horizontal on normal desktop VPS viewports. */
@media(min-width:901px){.customer-entry-card .receiver-grid,.sender-details-panel .receiver-grid{grid-template-columns:repeat(6,minmax(120px,1fr))}.customer-entry-card .wide2,.sender-details-panel .wide2{grid-column:span 6}}
@media(max-width:900px){.user-chip{order:20}.logout-btn{order:21}.staff-create-grid{grid-template-columns:1fr}.staff-row{align-items:flex-start;flex-direction:column}.staff-actions{width:100%;flex-wrap:wrap}}

/* V27 Completed daily-operation improvements */
.history-tools{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.history-date-filter{display:flex;flex-direction:column;gap:4px;min-width:165px}
.history-date-filter span{font-size:12px;font-weight:700;color:#31506f}
.history-date-filter input{height:38px}
.history-tools>input#historySearch{flex:1;min-width:280px}
.tracking-scan-input:focus{outline:2px solid #2f80ed;box-shadow:0 0 0 3px rgba(47,128,237,.12)}
/* V27.3 compact staff ownership */
.history-by,.history-by-head{width:38px;min-width:38px;max-width:38px;text-align:center;font-weight:700;white-space:nowrap}
.history-locked{opacity:.82}
.history-locked .history-input:disabled{background:#f4f6f8;color:#667085;cursor:not-allowed}
.staff-code-badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:2px 6px;margin-left:6px;border:1px solid #cbd5e1;border-radius:6px;font-size:11px;font-weight:800;letter-spacing:.4px;background:#f8fafc}

/* V27.4 — compact Completed layout, visible Courier, background tracking queue */
.grouped-history th:nth-child(1){width:3%}.grouped-history th:nth-child(2){width:12%}.grouped-history th:nth-child(3){width:10%}.grouped-history th:nth-child(4){width:25%}.grouped-history th:nth-child(5){width:5%}.grouped-history th:nth-child(6){width:6%}.grouped-history th:nth-child(7){width:15%}.grouped-history th:nth-child(8){width:3%}.grouped-history th:nth-child(9){width:7%}.grouped-history th:nth-child(10){width:7%}.grouped-history th:nth-child(11){width:7%}
.grouped-history td:last-child{min-width:0!important}.grouped-history tbody tr{height:auto!important;min-height:0!important}.grouped-history tbody td{padding:4px 5px!important;height:auto!important;vertical-align:middle!important;line-height:1.2}.grouped-history .history-input{height:28px!important;padding:3px 5px!important}.tracking-cell{gap:2px}.tracking-actions{min-height:16px;gap:4px;justify-content:flex-start;white-space:nowrap}.delivered-check{font-size:9px}.history-courier-actions{display:flex;align-items:center;justify-content:center;gap:3px;flex-wrap:nowrap!important;white-space:nowrap}.history-courier{font-size:9px!important;padding:3px 4px!important;white-space:nowrap!important}.compact-delete{width:19px;height:19px;min-width:19px;padding:0!important;line-height:17px;font-size:13px!important;border-radius:50%}.manual-tag{display:none}.tracking-save-status{font-size:9px;font-weight:800;min-width:10px}.tracking-save-status.saving{color:#946200}.tracking-save-status.saved{color:#16803b}.tracking-save-status.error{color:#b42318;white-space:normal}.tracking-save-error td{background:#fff1f1!important}.history-notice.error{border-color:#f0b4b4;background:#fff1f1;color:#9f1c1c}


/* V27.4.3 — lightweight Completed search status (no staged percentage animation) */
.history-search-status{margin:-2px 0 14px;padding:8px 12px;background:#fff;border:1px solid #d7e3f1;border-radius:10px;box-shadow:0 2px 8px rgba(15,70,130,.04);align-items:center;gap:10px;color:#123e70}
.history-search-status strong{white-space:nowrap}
#historySearchTiming{margin:0}

/* V27.5 - Pos Laju address helper, Standby sender switch and compact Completed weight */
.pos-address-helper{margin:8px 0 4px;padding:10px 12px;border-radius:10px}.pos-address-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.pos-address-head strong,.pos-address-helper small{font-variant-numeric:tabular-nums}.pos-address-helper .over{color:#b42318;font-weight:700}.pos-address-helper textarea{width:100%;margin-top:6px;resize:vertical;background:#fffdf7;border:1px solid #e8c56f}.standby-sender-change{display:flex;align-items:center;gap:7px;margin-top:5px;flex-wrap:wrap}.standby-sender-change>span{font-size:12px;font-weight:700;color:#425466}.standby-sender-change select{min-width:220px;max-width:360px;height:30px;padding:3px 28px 3px 8px}.standby-sender-change small{font-size:11px;color:#6b7280}.actual-weight-input{min-width:72px!important;width:78px!important}.history-tools+.history-search-status{min-height:28px}

/* V27.5.1 Completed compact column repair */
.grouped-history th:nth-child(1){width:3%}
.grouped-history th:nth-child(2){width:12%}
.grouped-history th:nth-child(3){width:10%}
.grouped-history th:nth-child(4){width:28%}
.grouped-history th:nth-child(5){width:6%}
.grouped-history th:nth-child(6){width:5%}
.grouped-history th:nth-child(7){width:6%}
.grouped-history th:nth-child(8){width:13%}
.grouped-history th:nth-child(9){width:4%}
.grouped-history th:nth-child(10){width:7%}
.grouped-history th:nth-child(11){width:7%}
.grouped-history th:nth-child(12){width:7%}
.grouped-history .ma-weight-input,.grouped-history .actual-weight-input{width:64px!important;min-width:0!important;max-width:100%}
.grouped-history .tracking-scan-input{width:100%!important;min-width:0!important}
.grouped-history .history-by{text-align:center;white-space:nowrap;font-weight:700}

/* V28 Pending Tracking */
.pending-tracking-card{padding:0;overflow:hidden}.pending-tracking-table{width:100%;border-collapse:collapse;table-layout:fixed}.pending-tracking-table th{background:#eaf1f9;color:#23476f;text-align:left;padding:9px 10px;font-size:12px}.pending-tracking-table td{padding:8px 10px;border-top:1px solid #e6edf5;vertical-align:middle}.pending-tracking-table th:nth-child(1){width:5%}.pending-tracking-table th:nth-child(2){width:30%}.pending-tracking-table th:nth-child(3){width:45%}.pending-tracking-table th:nth-child(4){width:20%}.pending-tracking-input{width:calc(100% - 85px);height:36px;padding:6px 9px;border:1px solid #b9c9dc;border-radius:7px;font-size:14px}.pending-tracking-input:focus{outline:2px solid #3b82f6;border-color:#3b82f6}.pending-save-status{display:inline-block;margin-left:8px;font-size:11px;min-width:65px}.pending-save-status.saved{color:#16803c;font-weight:800}.pending-save-status.error{color:#b42318;font-weight:700}.pending-tracking-card+.card{margin-top:12px}.history-weight{white-space:nowrap;font-weight:600;color:#334155}

/* V29.1 side-by-side WhatsApp recognition preview */
.paste-compare-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.paste-compare-pane{min-width:0}
.paste-compare-title{font-weight:800;margin:0 0 7px 2px;color:#183b66;min-height:20px}
.paste-compare-title .small{font-weight:400;margin-left:6px}
.paste-compare-pane #rawText{width:100%;box-sizing:border-box;margin:0;resize:vertical;min-height:322px}
.paste-cleanup-preview{padding:0;border:1px solid #b9c9dc;border-radius:8px;background:#fff;min-height:322px;box-sizing:border-box;overflow:auto}
.paste-cleanup-preview pre{margin:0;white-space:pre-wrap;word-break:break-word;font:inherit;line-height:1.45;background:transparent;border:0;padding:10px 11px;min-height:300px;box-sizing:border-box}
.paste-cleanup-preview .paste-cleanup-empty{color:#94a3b8}
.cleanup-label del{color:#9aa3af;text-decoration-thickness:2px}
@media(max-width:900px){.paste-compare-grid{grid-template-columns:1fr}.paste-compare-pane #rawText,.paste-cleanup-preview{min-height:240px}.paste-cleanup-preview pre{min-height:218px}}

/* V29.2 single-panel Smart Paste */
.smart-paste-wrap{width:100%}
.smart-paste-editor{width:100%;box-sizing:border-box;min-height:322px;padding:11px 12px;border:1px solid #8fb4df;border-radius:8px;background:#fff;white-space:pre-wrap;word-break:break-word;font:inherit;line-height:1.45;outline:none;overflow:visible}
.smart-paste-editor:focus{border-color:#2f80ed;box-shadow:0 0 0 2px rgba(47,128,237,.14)}
.smart-paste-editor:empty:before{content:attr(data-placeholder);color:#94a3b8;pointer-events:none}
.smart-paste-editor .cleanup-label{color:#98a2b3}
.smart-paste-editor .cleanup-label del{text-decoration-thickness:1.5px}
@media(max-width:900px){.smart-paste-editor{min-height:240px}}
.pending-sender{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pending-sender .smallbtn{padding:5px 10px;min-height:30px}
