/* R167: one inline multiwarehouse shipping queue in existing /shipping page. */
.afm-r167-shipping{direction:rtl;margin:18px 0 22px;border:1px solid #b9d9d0;background:linear-gradient(135deg,#fcfffe,#f3faf7);padding:20px;border-radius:20px}
.afm-r167-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.afm-r167-heading h2{font-size:1.12rem;font-weight:850;color:#174f44;margin:0 0 5px}
.afm-r167-heading p,.afm-r167-card p{font-size:.88rem;color:#54736c;margin:0}
.afm-r167-heading button{white-space:nowrap}
.afm-r167-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:16px}
.afm-r167-card{border:1px solid #d4e4dd;border-radius:18px;background:#fff;padding:16px;box-shadow:0 6px 16px #102e2210}
.afm-r167-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}
.afm-r167-card-head strong{color:#173d34;display:block;font-size:1rem}
.afm-r167-card-head small{color:#647971}
.afm-r167-tag{font-size:.76rem;color:#1b5b4c;background:#e9f6ef;padding:6px 12px;border-radius:999px;white-space:nowrap}
.afm-r167-hold{font-size:.82rem;padding:10px 12px;border:1px solid #f3c2c2;color:#992e31;background:#fff1ef;border-radius:11px;margin:10px 0}
.afm-r167-lines{display:grid;gap:8px;margin:12px 0}
.afm-r167-line{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e2eae6;border-radius:11px;background:#f8fbf9;padding:9px}
.afm-r167-line b{font-size:.87rem;color:#24413a}
.afm-r167-line small{display:block;font-size:.76rem;color:#6f8079;margin-top:3px}
.afm-r167-line span{white-space:nowrap;font-size:.8rem}
.afm-r167-stats{display:flex;align-items:center;gap:14px;flex-wrap:wrap;color:#4c665c;font-size:.84rem}
.afm-r167-actions{display:flex;gap:9px;margin-top:14px;flex-wrap:wrap;align-items:center}
.afm-r167-actions button{min-height:39px;border-radius:11px;cursor:pointer}
.afm-r167-actions button:disabled{cursor:not-allowed;opacity:.54}
.afm-r167-history{border-top:1px dashed #d8e4dc;margin-top:13px;padding-top:9px;color:#5e706a;font-size:.81rem;line-height:1.9}
.afm-r167-history b{display:block;color:#2e594c;font-size:.82rem}
.afm-r167-message{border-radius:12px;padding:11px 13px;margin:9px 0 16px;font-size:.88rem}
.afm-r167-success{background:#e5f7eb;color:#16553c}
.afm-r167-error{background:#fff0ed;color:#a42f27;border:1px solid #e8b9b0}
.afm-r167-modal{position:fixed;inset:0;z-index:1500;background:#132b2988;display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto}
.afm-r167-dialog{background:#fff;max-width:850px;width:100%;max-height:min(92vh,950px);overflow-y:auto;overscroll-behavior:contain;border-radius:20px;padding:22px;box-shadow:0 24px 80px #06201855;direction:rtl}
.afm-r167-dialog h3{font-size:1.12rem;color:#123d33;margin:0 0 5px}
.afm-r167-dialog>.muted{margin:0 0 15px}
.afm-r167-amounts{display:grid;gap:7px;margin:14px 0;padding:12px;background:#f0f8f5;border-radius:13px}
.afm-r167-amounts label{display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:.87rem}
.afm-r167-amounts input{max-width:95px;min-width:70px;padding:9px 10px;border-radius:9px;border:1px solid #b9cfc5}
.afm-r167-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.afm-r167-field{display:flex;flex-direction:column;gap:6px;font-size:.86rem;font-weight:650;color:#335348}
.afm-r167-field input{width:100%;padding:10px 12px;border:1px solid #bfd2ca;border-radius:10px;background:#fff;color:#183d34;font:inherit;box-sizing:border-box}
.afm-r167-field input:focus,.afm-r167-amounts input:focus{outline:2px solid #589780;outline-offset:1px}
.afm-r167-dialog .afm-r167-actions{margin-top:20px;justify-content:flex-end}
@media(max-width:740px){
 .afm-r167-shipping{padding:13px;border-radius:14px}
 .afm-r167-heading{align-items:flex-start;flex-direction:column}
 .afm-r167-fields{grid-template-columns:1fr}
 .afm-r167-card-head{flex-wrap:wrap}
 .afm-r167-line{flex-wrap:wrap}
 .afm-r167-dialog{padding:14px;max-height:96vh}
}

/* Portalled to document.body; always above navigation and page transforms. */
body > .afm-r167-modal {
  position:fixed!important;
  inset:0!important;
  z-index:2147483000!important;
  min-height:100dvh;
  width:100%;
  box-sizing:border-box;
  padding:max(18px,env(safe-area-inset-top)) 18px max(18px,env(safe-area-inset-bottom));
  overscroll-behavior:contain;
}
body > .afm-r167-modal .afm-r167-dialog {
  max-height:calc(100dvh - 36px);
  width:min(100%,860px);
  box-sizing:border-box;
}

/* R169: segmented Iranian plate, read-only address from invoice snapshot. */
.afm-r169-address {grid-column:1 / -1}
.afm-r169-address textarea {
  width:100%;min-height:68px;resize:none;border-radius:11px;
  padding:11px 12px;font:inherit;color:#345549;
  border:1px solid #bbd7c9;box-sizing:border-box;
  background:#eff7f3;cursor:default;line-height:1.75;
}
.afm-r169-plate-field {grid-column:1 / -1;min-width:0}
.afm-r169-label {display:block;font-size:.9rem;font-weight:700;margin-bottom:7px;color:#335348}
.afm-r169-plate {display:flex;gap:0;align-items:stretch;overflow:hidden;
  border:2px solid #1b6255;border-radius:13px;background:#fff;max-width:560px;
  box-shadow:0 1px 2px rgba(0,0,0,.05)}
.afm-r169-plate-part {flex:1;min-width:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;padding:7px 6px;
  border-right:1px solid #d9e7df}
.afm-r169-plate-part:last-child {border-right:0}
.afm-r169-plate-part small {font-size:.72rem;color:#617b71;white-space:nowrap}
.afm-r169-plate-part input,.afm-r169-plate-part select {
  display:block;width:100%;min-width:0;padding:3px 0;
  background:transparent;border:0;outline-offset:2px;
  text-align:center;color:#1a3a32;font-size:1.32rem;font-weight:800;
  box-sizing:border-box;font-family:inherit}
.afm-r169-plate-part input::placeholder {color:#aebfb7}
.afm-r169-plate-part select {appearance:auto}
.afm-r169-iran {background:#eef8ff;border-left:2px solid #2983a8;max-width:95px}
.afm-r169-note {font-size:.78rem;color:#658179;margin-top:6px;display:block;line-height:1.55}
@media(max-width:520px){
  .afm-r169-plate-part {padding:6px 3px}
  .afm-r169-plate-part input,.afm-r169-plate-part select {font-size:1.05rem}
  .afm-r169-iran {max-width:68px}
}

/* R170: recipient is the fixed invoice customer. */
.afm-r170-receiver input[readonly] {
  background:#eff7f3;
  border:1px solid #bbd7c9;
  color:#254b3d;
  cursor:default;
  font-weight:700;
}

/* R174: invoice recipient identity is locked; never allow warehouse edits. */
.afm-r174-locked-receiver input[readonly] {
  background:#eff7f3;
  border:1px solid #bbd7c9;
  color:#254b3d;
  font-weight:700;
  cursor:default;
}
