/* The result overlay lives outside the drawer, so it needs its own scoped skin. */
#ManifestJobResultOverlay {position:fixed;z-index:2147483647;inset:0;background:rgba(23,44,67,.38);padding:3vh 3vw;box-sizing:border-box;direction:rtl;font:14px/1.8 wyekan,Tahoma,sans-serif}
#ManifestJobResultOverlay .manifest-result-dialog {height:94vh;display:flex;flex-direction:column;background:#f5f8fa;border:1px solid #dce5eb;border-radius:14px;overflow:hidden;box-shadow:0 12px 40px #172c4333}
#ManifestJobResultOverlay .manifest-result-header {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 18px;background:#fff;border-bottom:1px solid #dce5eb;flex-shrink:0}
#ManifestJobResultOverlay h2 {font:inherit;font-size:15px;font-weight:400;color:#7b8086;margin:0}
#ManifestJobResultOverlay .manifest-result-close {display:inline-flex;align-items:center;gap:8px;font:inherit;min-height:40px;padding:6px 16px;border:1px solid #d4e0e8;border-radius:9px;background:#f5f8fa;color:#40556c;cursor:pointer;white-space:nowrap}
#ManifestJobResultOverlay .manifest-result-close:hover {background:#eaf3f3;border-color:#a8c9c6;color:#146b70}
#ManifestJobResultOverlay .manifest-result-close:focus-visible {outline:2px solid #146b70;outline-offset:3px}
#ManifestJobResultOverlay iframe {width:100%;flex:1;min-height:0;border:0;background:#f5f8fa}
@media(max-width:600px){#ManifestJobResultOverlay {padding:8px}#ManifestJobResultOverlay .manifest-result-dialog {height:calc(100dvh - 16px)}#ManifestJobResultOverlay .manifest-result-header {padding:8px 12px}}

/* Failed consignments from a completed Tipax status update. */
.tipax-failures-button{padding:3px 9px;font:11px wyekan,Tahoma,sans-serif;border:1px solid #b45454;border-radius:4px;background:#fff;color:#9b2c2c;cursor:pointer}
#TipaxSyncFailuresOverlay{position:fixed;z-index:2147483647;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;background:rgba(23,44,67,.38);direction:rtl;font:14px/1.8 wyekan,Tahoma,sans-serif}
#TipaxSyncFailuresOverlay *{box-sizing:border-box}
#TipaxSyncFailuresOverlay .tipax-failures-dialog{display:flex;flex-direction:column;width:1050px;max-width:100%;max-height:90vh;background:#fff;border:1px solid #dce5eb;border-radius:14px;overflow:hidden;box-shadow:0 12px 40px #172c4333}
#TipaxSyncFailuresOverlay header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;border-bottom:1px solid #dce5eb;flex-shrink:0}
#TipaxSyncFailuresOverlay h2{margin:0;font:inherit;font-size:16px;color:#243746}
#TipaxSyncFailuresOverlay h2 span{display:inline-block;direction:ltr;color:#667085}
#TipaxSyncFailuresOverlay button{font:inherit;min-height:40px;padding:6px 16px;border:1px solid #d4e0e8;border-radius:9px;background:#f5f8fa;color:#40556c;cursor:pointer;white-space:nowrap}
#TipaxSyncFailuresOverlay button:hover{background:#eaf3f3;color:#146b70}
#TipaxSyncFailuresOverlay :focus-visible,.tipax-failures-button:focus-visible{outline:2px solid #146b70;outline-offset:2px}
#TipaxSyncFailuresOverlay .tipax-failures-body{display:flex;flex-direction:column;min-height:0;padding:16px;overflow:auto}
#TipaxSyncFailuresOverlay .tipax-failures-summary{margin:0 0 14px;color:#40556c;flex-shrink:0}
#TipaxSyncFailuresOverlay .tipax-failures-table-wrap{overflow:auto;border:1px solid #e1e7ec;border-radius:8px;overscroll-behavior:contain}
#TipaxSyncFailuresOverlay table{width:100%;min-width:650px;border-collapse:collapse;font:inherit;text-align:right;color:#243746}
#TipaxSyncFailuresOverlay th{position:sticky;top:0;background:#f5f8fa;font-weight:normal;white-space:nowrap}
#TipaxSyncFailuresOverlay th,#TipaxSyncFailuresOverlay td{padding:10px 12px;border-bottom:1px solid #e1e7ec;vertical-align:top}
#TipaxSyncFailuresOverlay tr:last-child td{border-bottom:0}
#TipaxSyncFailuresOverlay .tipax-failures-code{direction:ltr;text-align:right;white-space:nowrap}
#TipaxSyncFailuresOverlay .tipax-failures-error{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;min-width:200px;color:#9b2c2c}
#TipaxSyncFailuresOverlay .tipax-failures-empty{margin:0;padding:24px;text-align:center;color:#667085}
@media(max-width:600px){
    #TipaxSyncFailuresOverlay{padding:8px}
    #TipaxSyncFailuresOverlay .tipax-failures-dialog{max-height:calc(100dvh - 16px)}
    #TipaxSyncFailuresOverlay header{gap:8px;padding:10px 12px}
    #TipaxSyncFailuresOverlay h2{font-size:14px}
    #TipaxSyncFailuresOverlay .tipax-failures-body{padding:10px}
    #TipaxSyncFailuresOverlay table,#TipaxSyncFailuresOverlay tbody{display:block;min-width:0;width:100%}
    #TipaxSyncFailuresOverlay thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
    #TipaxSyncFailuresOverlay tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 12px;padding:12px;border-bottom:1px solid #e1e7ec}
    #TipaxSyncFailuresOverlay tbody tr:last-child{border-bottom:0}
    #TipaxSyncFailuresOverlay td{padding:0;border:0;min-width:0;white-space:normal;overflow-wrap:anywhere}
    #TipaxSyncFailuresOverlay .tipax-failures-code{white-space:normal;word-break:break-all}
    #TipaxSyncFailuresOverlay .tipax-failures-error{min-width:0}
    #TipaxSyncFailuresOverlay td:first-child{display:none}
    #TipaxSyncFailuresOverlay td:nth-child(4),#TipaxSyncFailuresOverlay td:nth-child(5){grid-column:1/-1}
    #TipaxSyncFailuresOverlay td::before{content:attr(data-label);display:block;direction:rtl;color:#667085;font-size:11px;margin-bottom:2px}
}

/* Floating rate calculator, independent of the scrolling page shell. */
@media(max-width:700px){body #calculator.calculator {position:fixed!important;top:auto!important;right:auto!important;bottom:calc(58px + env(safe-area-inset-bottom,0px))!important;left:12px!important;cursor:pointer;touch-action:manipulation}}
#calculator.calculator{position:fixed;inset:auto auto 112px 16px;display:flex!important;align-items:center;gap:8px;width:auto;height:44px;padding:0 14px;border:1px solid #0f6065;border-radius:14px;background:#146b70;color:#fff;box-shadow:0 5px 18px #172c432b;font:13px/1.5 wyekan,Tahoma,sans-serif;z-index:9000;cursor:grab;touch-action:none;user-select:none;direction:rtl}
#calculator svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#calculator:hover{background:#105b60}
#calculator.is-dragging{cursor:grabbing;box-shadow:0 8px 24px #172c4340}
#calculator:focus-visible{outline:3px solid #7ac8cc;outline-offset:3px}
@media(max-width:600px){#calculator.calculator{bottom:calc(112px + env(safe-area-inset-bottom,0px));left:12px;height:42px;padding:0 10px;font-size:12px}}

/* Shared skin for the existing Jalali and Gregorian calendar engines. */
div.calendar{border:1px solid #d7e3e9;border-radius:14px;padding:8px;background:#fff;box-shadow:0 12px 36px #172c4330;z-index:30000;color:#40556c;font:12px/1.7 wyekan,Tahoma,sans-serif}
.calendar table{border:0;background:#fff;color:#40556c;font:inherit;border-collapse:separate;border-spacing:2px}
.calendar thead tr,.calendar thead .title,.calendar .button{background:#edf6f5;color:#245d62;border:0;border-radius:6px}
.calendar thead .title{padding:8px;font-size:13px}
.calendar .button,.calendar thead .name{padding:6px;border:0}
.calendar tbody .day{padding:6px;text-align:center;border:1px solid transparent;border-radius:7px;min-width:24px;background:#fff;color:#40556c}
.calendar tbody td.hilite,.calendar thead .hilite,.calendar .combo .hilite{background:#e1f0ee;color:#146b70;border-color:#c5dfdb;padding:6px}
.calendar tbody td.selected{background:#146b70!important;color:#fff!important;border:1px solid #146b70!important;padding:6px!important;font-weight:bold}
.calendar tbody td.today{border-color:#73b3b0;font-weight:bold;color:#146b70}
.calendar tbody .day.weekend,.calendar thead .weekend{color:#b54c56}
.calendar tbody .disabled,.calendar tbody .othermonth{color:#a7b3be}
.calendar tfoot .ttip{background:#f5f8fa;color:#758593;border:0;padding:6px;border-radius:6px}
.calendar .combo{background:#fff;color:#40556c;border:1px solid #d7e3e9;border-radius:8px;box-shadow:0 6px 20px #172c4326;font:inherit;padding:4px}
.calendar .combo .label{padding:5px 10px;border-radius:4px}
.calendar .combo .active{background:#146b70;color:#fff}
.calendar td.time{background:#f5f8fa;border-color:#d7e3e9;padding:7px;color:#40556c}

/* Excel preview shares the screen with its upload form. */
body.manifest-preview-layout{--manifest-form-width:clamp(360px,32vw,420px)}
#HolderFormImportManifest.manifest-preview-open{--portal-drawer-width:var(--manifest-form-width)}
.manifest-preview-open #frm_Import_Manifest .manifest-import-panel{padding:10px;box-sizing:border-box}
.manifest-preview-open #frm_Import_Manifest .manifest-import-fields{padding:12px}
.manifest-preview-open #frm_Import_Manifest .manifest-import-fields tbody{grid-template-columns:1fr;gap:12px}
#ManifestPreviewPanel{position:fixed;left:8px;right:calc(var(--manifest-form-width) + 8px);bottom:8px;z-index:10003;display:flex;flex-direction:column;min-width:0;background:#fff;border:1px solid #cbdce5;border-radius:12px;box-shadow:0 8px 32px #24374633;overflow:hidden;font-family:wyekan,Tahoma,sans-serif}
#ManifestPreviewPanel>header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid #dce5eb}
#ManifestPreviewPanel h2{font:inherit;font-size:16px;margin:0;color:#243746}
#ManifestPreviewPanel header>div{display:flex;gap:8px;flex-wrap:wrap}
#ManifestPreviewPanel button{font:inherit;font-size:13px;min-height:38px;padding:6px 10px;border:1px solid #cbdce5;border-radius:7px;background:#f5f9fa;color:#176b70;cursor:pointer}
#ManifestPreviewPanel button:focus-visible{outline:2px solid #176b70;outline-offset:2px}
#ManifestPreviewPanel>iframe{flex:1;min-height:0;width:100%;border:0;background:#f5f8fa}
#ManifestPreviewPanel.is-expanded{right:8px}
@media(max-width:760px){#ManifestPreviewPanel{right:8px}}
