/* Manual order only. Preserve fields, validation and upload behavior. */
#modal-backdrop .modal-card:has(#manual-deal-form){width:min(700px,calc(100vw - 20px))!important;min-width:0!important;height:auto!important;min-height:0!important;max-height:calc(100dvh - 20px)!important;padding:10px 12px!important;overflow:auto;box-sizing:border-box}
#modal-content:has(#manual-deal-form){min-width:0}
#modal-content:has(#manual-deal-form)>.modal-label{font-size:8px;line-height:1.2;padding:3px 5px;margin:0 0 3px}
#modal-content:has(#manual-deal-form)>h2{font-size:18px!important;line-height:1.15!important;margin:2px 32px 5px 0!important;padding:0}
#modal-content:has(#manual-deal-form)>p{font-size:10px;line-height:1.25;margin:0 0 6px;color:#80736a}
#modal-content #manual-deal-form{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 7px!important;margin:0!important;padding:0;min-width:0;font-size:10px;line-height:1.2}
#manual-deal-form>*{min-width:0;max-width:100%;box-sizing:border-box}
#manual-deal-form>:is(.modal-form-grid,.form-error,button),#manual-deal-form>label:has([name="externalNumber"]){grid-column:1/-1}
#modal-content #manual-deal-form .modal-form-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px 7px!important;margin:0;padding:0}
#modal-content #manual-deal-form label{display:flex!important;flex-direction:column;gap:2px!important;margin:0!important;padding:0;font-size:10px!important;line-height:1.2!important;font-weight:600;min-width:0;color:#66584f}
#modal-content #manual-deal-form :is(input:not([type="checkbox"]):not([type="hidden"]),select){width:100%!important;min-width:0!important;max-width:100%;height:26px!important;min-height:26px!important;box-sizing:border-box;padding:3px 6px!important;margin:0!important;font-size:10px!important;line-height:1.2!important;font-weight:400;border-radius:6px!important;font-family:inherit}
#modal-content #manual-deal-form textarea{width:100%!important;min-width:0;max-width:100%;height:40px!important;min-height:40px!important;max-height:110px;box-sizing:border-box;padding:4px 6px!important;margin:0!important;font:inherit;font-size:10px!important;line-height:1.2!important;border-radius:6px!important;resize:vertical}
#modal-content #manual-deal-form small{display:block;font-size:8px!important;line-height:1.2!important;font-weight:400;margin:0!important;color:#8b7b6e;overflow-wrap:anywhere}
#modal-content #manual-deal-form label:has([name="excludeFromStructure"])>span{display:flex!important;align-items:flex-start;gap:5px;min-height:22px;font-size:10px;line-height:1.2}
#modal-content #manual-deal-form input[type="checkbox"]{display:inline-block!important;flex:none!important;width:13px!important;height:13px!important;min-height:13px!important;margin:1px 0 0!important;padding:0!important;border-radius:3px!important;accent-color:#f46c36}
#modal-content #manual-deal-form input[type="file"]{height:26px!important;min-height:26px!important;padding:1px 3px!important;border:1px solid #d9dfe7!important;background:#fff!important;box-shadow:none!important;color:#66584f!important;cursor:pointer}
#modal-content #manual-deal-form input[type="file"]::file-selector-button{height:22px!important;min-height:22px!important;margin:0 5px 0 0!important;padding:2px 6px!important;border:1px solid #d8c3b5!important;border-radius:4px!important;background:#fff6ee!important;color:#8a431f!important;box-shadow:none!important;font:inherit!important;font-size:9px!important;font-weight:600!important;letter-spacing:0!important;text-transform:none!important;transform:none!important}
#modal-content #manual-deal-form .form-error{margin:0;padding:0;font-size:10px;line-height:1.2}
#modal-content #manual-deal-form>button[type="submit"]{min-height:26px!important;height:auto!important;padding:5px 8px!important;margin:0!important;font-size:10px!important;line-height:1.2;border-radius:6px;white-space:normal}
html[data-theme="dark"] #modal-content:has(#manual-deal-form)>p,html[data-theme="dark"] #modal-content #manual-deal-form label{color:#d9c9bf}
html[data-theme="dark"] #modal-content #manual-deal-form small{color:#b9a89b}
html[data-theme="dark"] #modal-content #manual-deal-form input[type="file"]{border-color:#514138!important;background:#211d1a!important;color:#f6eee8!important}
html[data-theme="dark"] #modal-content #manual-deal-form input[type="file"]::file-selector-button{border-color:#795d49!important;background:#3b2c23!important;color:#f4c7a6!important}
@media(max-width:680px){
  #modal-backdrop .modal-card:has(#manual-deal-form){width:calc(100vw - 10px)!important;max-height:calc(100dvh - 10px)!important;padding:8px!important;border-radius:10px!important}
  #modal-content:has(#manual-deal-form)>h2{font-size:18px!important;margin-bottom:4px!important}
  #modal-content:has(#manual-deal-form)>p{font-size:9px;line-height:1.2;margin-bottom:5px}
  #modal-content #manual-deal-form,#modal-content #manual-deal-form .modal-form-grid{gap:4px 5px!important}
  #modal-content #manual-deal-form :is(input:not([type="checkbox"]):not([type="hidden"]),select){height:40px!important;min-height:40px!important;padding:5px 6px!important;font-size:16px!important;line-height:1.2!important}
  #modal-content #manual-deal-form textarea{height:40px!important;min-height:40px!important;padding:5px 6px!important;font-size:16px!important}
  #modal-content #manual-deal-form label:has([name="excludeFromStructure"])>span{min-height:40px;align-items:flex-start;font-size:10px;line-height:1.2}
  #modal-content #manual-deal-form input[type="checkbox"]{width:18px!important;height:18px!important;min-height:18px!important}
  #manual-deal-form>label:has([name="orderFile"]),#manual-deal-form>label:has([name="note"]){grid-column:1/-1}
  #modal-content #manual-deal-form label:has(:is([name="collectedAt"],[name="amount"],[name="orderFile"]))>small{display:none!important}
  #modal-content #manual-deal-form input[type="file"]{height:40px!important;min-height:40px!important;padding:3px!important;font-size:11px!important}
  #modal-content #manual-deal-form input[type="file"]::file-selector-button{height:32px!important;min-height:32px!important;padding:4px 7px!important;font-size:11px!important}
  #modal-content #manual-deal-form>button[type="submit"]{height:40px!important;min-height:40px!important;font-size:11px!important}
}
