.aca-manual fieldset,.aca-workflow{border:1px solid #dce3eb;border-radius:12px;padding:20px;margin:0 0 20px;background:#fff;color:#172033}
.aca-manual legend{font-weight:700;padding:0 8px;font-size:16px}
.aca-manual-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.aca-manual label,.aca-workflow label{display:flex;flex-direction:column;gap:7px;font-size:13px;margin-bottom:10px}
.aca-manual input,.aca-manual select,.aca-manual textarea,.aca-workflow input:not([type=checkbox]),.aca-workflow select,.aca-workflow textarea{box-sizing:border-box;width:100%;min-width:0;min-height:42px;padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font:inherit;color:#172033}
.aca-manual :focus-visible,.aca-workflow :focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.aca-span-all{grid-column:1/-1}.aca-manual-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.aca-manual button,.aca-workflow button,.aca-manual-primary{border:0;border-radius:8px;background:#334155;color:#fff;padding:11px 16px;font:inherit;cursor:pointer;text-decoration:none}
.aca-manual button:disabled,.aca-workflow button:disabled{opacity:.5;cursor:not-allowed}
.aca-manual-item{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) 80px auto;align-items:center;gap:12px;border-bottom:1px solid #e2e8f0;padding:12px 0}
#aca-product-results{display:grid;gap:8px;margin:12px 0}#aca-product-results button{background:#eff6ff;color:#172033;text-align:right}
.aca-manual-summary{padding:20px;background:#edf3f8;border-radius:12px;margin-bottom:20px}.aca-manual-summary p{margin:8px 0}
.aca-manual-message:not(:empty){padding:12px;border:1px solid #cbd5e1;background:#f8fafc;border-radius:8px;margin-bottom:16px;white-space:pre-wrap}
.aca-workflow details{margin-top:20px}.aca-workflow summary{cursor:pointer;padding:8px 0}.aca-workflow input[type=checkbox]{width:18px;height:18px}
@media(max-width:640px){.aca-manual-grid{grid-template-columns:1fr}.aca-manual-item{grid-template-columns:minmax(0,1fr) 80px}.aca-manual fieldset,.aca-workflow{padding:14px}.aca-manual .aca-agent-section-title{flex-direction:column}}

.aca-manual-message[data-state=success]{background:#ecfdf5;border-color:#6ee7b7;color:#065f46}
.aca-manual-message[data-state=error]{background:#fff7ed;border-color:#fdba74;color:#9a3412}
.aca-search-loading{display:flex;align-items:center;gap:10px;color:#475569}
.aca-search-loading::before{content:"";width:18px;height:18px;border:2px solid #cbd5e1;border-top-color:#2563eb;border-radius:50%;animation:aca-search-spin .8s linear infinite;flex-shrink:0}
@keyframes aca-search-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.aca-search-loading::before{animation:none}}

/* Semantic feedback: text and symbols supplement color, including in the floating notice. */
.aca-manual-message:not(:empty){border-inline-start-width:4px;line-height:1.9;font-weight:500}
.aca-manual-message[data-state=info]{background:#eff6ff;border-color:#93c5fd;color:#1e40af}
.aca-manual-message[data-state=warning]{background:#fffbeb;border-color:#f59e0b;color:#92400e}
.aca-manual-message[data-state=error]{background:#fef2f2;border-color:#f87171;color:#991b1b}
.aca-manual-message[data-state=success]::before{content:"✓  ";font-weight:700}
.aca-manual-message[data-state=warning]::before,.aca-manual-message[data-state=error]::before{content:"⚠  ";font-weight:700}
.aca-manual-toast{position:fixed;z-index:100000;top:calc(24px + env(safe-area-inset-top,0px));right:24px;width:min(460px,calc(100vw - 32px));box-sizing:border-box;padding:18px;border:1px solid #cbd5e1;border-inline-start-width:5px;border-radius:14px;background:#fff;color:#172033;box-shadow:0 14px 45px #0f172a26;font-family:inherit;display:flex;align-items:flex-start;gap:12px;max-height:calc(100dvh - 100px);overflow:auto}
body.admin-bar .aca-manual-toast{top:calc(64px + env(safe-area-inset-top,0px))}
.aca-manual-toast>div{display:flex;gap:12px;flex:1;min-width:0}
.aca-manual-toast[data-state=success]{background:#ecfdf5;border-color:#34d399;color:#065f46}
.aca-manual-toast[data-state=warning]{background:#fffbeb;border-color:#f59e0b;color:#92400e}
.aca-manual-toast[data-state=error]{background:#fef2f2;border-color:#f87171;color:#991b1b}
.aca-manual-toast .aca-notice-icon{display:grid;place-items:center;width:28px;height:28px;border:1px solid currentColor;border-radius:50%;flex-shrink:0;font-weight:700}
.aca-manual-toast .aca-notice-content{min-width:0}.aca-manual-toast strong{display:block;font-size:15px;color:inherit}.aca-manual-toast p{margin:6px 0 0;font-size:14px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;color:inherit}
.aca-manual-toast .aca-toast-close{display:grid;place-items:center;padding:0;min-width:36px;width:36px;min-height:36px;height:36px;line-height:1;border:0;border-radius:8px;background:transparent;color:inherit;box-shadow:none;cursor:pointer;font-size:26px}
.aca-manual-toast .aca-toast-close:hover{background:#0000000a}.aca-manual-toast .aca-toast-close:focus-visible{outline:2px solid currentColor;outline-offset:2px}
@media(max-width:640px){.aca-manual-toast{right:16px;padding:14px}body.admin-bar .aca-manual-toast{top:calc(62px + env(safe-area-inset-top,0px))}}

#aca-product-results .aca-search-loading{display:flex;align-items:center;gap:12px;min-height:54px;box-sizing:border-box;padding:14px 16px;margin:0;border:1px solid #bfdbfe;border-radius:10px;background:#eff6ff;color:#1e40af;font-size:14px;font-weight:600}
#aca-product-results .aca-search-loading::before{content:none}
#aca-product-results .aca-search-spinner{display:block;width:22px;height:22px;box-sizing:border-box;border:3px solid #bfdbfe;border-top-color:#2563eb;border-radius:50%;flex-shrink:0;animation:aca-search-spin .75s linear infinite}
@media(prefers-reduced-motion:reduce){#aca-product-results .aca-search-spinner{animation:none}}

/* Override theme hover text without changing light product-result buttons. */
.aca-agent-dashboard .aca-manual-primary:is(:hover, :focus-visible, :active),
.aca-manual button:not(#aca-product-results button):not(.aca-toast-close):is(:hover, :focus-visible, :active),
.aca-workflow button:not(.aca-toast-close):is(:hover, :focus-visible, :active) {
    background: #243247;
    color: #fff !important;
    text-decoration: none;
}
#aca-product-results button:is(:hover, :focus-visible, :active) {
    background: #dbeafe;
    color: #172033 !important;
}

#aca-history-fields[hidden]{display:none!important}
.aca-history-entry input[type="checkbox"]{width:auto;min-height:0;margin-inline-end:8px}
#aca-history-fields{margin-top:16px;padding:16px;background:#f1f5f9;border-radius:12px}
.aca-manual .aca-history-entry > label,.aca-manual #aca-history-fields > label{flex-direction:row;align-items:center;gap:8px;line-height:1.9}
.aca-manual .aca-history-entry input[type="checkbox"]{flex:0 0 18px;width:18px;height:18px;padding:0;margin:0;accent-color:#334155}

/* Prominent, whole-row targets; native checkboxes retain keyboard interaction. */
.aca-manual .aca-history-entry label.aca-important-option{display:flex;flex-direction:row;align-items:center;gap:16px;padding:20px;margin:8px 0 16px;border:2px solid #94a3b8;border-radius:12px;background:#f8fafc;cursor:pointer;box-sizing:border-box;line-height:1.8;transition:border-color .15s,background-color .15s}
.aca-manual .aca-important-option .aca-option-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.aca-manual .aca-important-option strong{font-size:16px;font-weight:700;color:#172033}
.aca-manual .aca-important-option .aca-option-copy>span{font-size:13px;color:#475569}
.aca-manual .aca-history-entry .aca-important-option input[type="checkbox"]{appearance:auto;-webkit-appearance:checkbox;flex:0 0 24px;width:24px;height:24px;min-height:24px;margin:0;padding:0;accent-color:#1e40af;cursor:pointer}
.aca-manual .aca-important-option .aca-option-state{flex:0 0 auto;padding:6px 12px;border-radius:8px;background:#e2e8f0;color:#334155;font-size:12px;font-weight:700}
.aca-manual .aca-history-entry .aca-important-option[data-active="yes"]{border-color:#2563eb;background:#eff6ff}
.aca-manual .aca-important-option[data-active="yes"] .aca-option-state{background:#dbeafe;color:#1e3a8a}
.aca-manual .aca-history-entry .aca-sms-option[data-active="yes"]{border-color:#0f766e;background:#f0fdfa}
.aca-manual .aca-sms-option[data-active="yes"] .aca-option-state{background:#ccfbf1;color:#115e59}
.aca-manual .aca-history-entry .aca-sms-option[data-active="no"]{border-color:#b45309;background:#fffbeb}
.aca-manual .aca-sms-option[data-active="no"] .aca-option-state{background:#fef3c7;color:#78350f}
.aca-manual .aca-important-option:focus-within{outline:3px solid #2563eb;outline-offset:3px}
.aca-manual .aca-important-option:hover{box-shadow:0 3px 12px #0f172a12}
@media(max-width:640px){.aca-manual .aca-history-entry label.aca-important-option{flex-wrap:wrap;padding:16px;gap:12px}.aca-manual .aca-important-option .aca-option-copy{flex-basis:calc(100% - 40px)}.aca-manual .aca-important-option .aca-option-state{margin-inline-start:36px}}
@media(prefers-reduced-motion:reduce){.aca-manual .aca-history-entry label.aca-important-option{transition:none}}

.aca-manual-item .aca-line-name{display:flex;flex-direction:column;gap:8px}
.aca-manual-item .aca-line-name small{color:#64748b;font-size:12px}
.aca-manual .aca-historical-item{grid-template-columns:minmax(0,2fr) minmax(180px,1.5fr) 80px auto;align-items:center;padding:18px 12px;background:#f8fafc;border-radius:10px;margin:10px 0;gap:16px}
.aca-manual .aca-line-price{margin:0;color:#1e3a8a;font-weight:600}
.aca-manual .aca-line-price input{background:#fff;border:2px solid #93c5fd;direction:ltr;text-align:right;font-weight:700}
.aca-manual .aca-line-price small{font-weight:400;color:#334155}
@media(max-width:640px){.aca-manual .aca-historical-item{grid-template-columns:minmax(0,1fr) 80px}.aca-historical-item .aca-line-name,.aca-historical-item .aca-line-price{grid-column:1/-1}}

/* Quotation costs in the existing manual-order form. */
.aca-manual textarea[name=transfer_reason]{min-height:80px;height:80px;resize:vertical}
#aca-manual-packaging{padding:12px 16px;border:1px solid #dce6df;border-radius:8px;background:#f0f5f1;font-size:14px;line-height:1.9}
#aca-manual-packaging p{margin:0 0 8px}#aca-manual-packaging p:last-child{margin:0}
#aca-manual-packaging strong{font-size:15px}

.aca-manual-detail{font-size:14px;line-height:1.9;color:#24352d}
.aca-manual-detail-header{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:24px 0}
.aca-manual-detail h3{font-size:17px;line-height:1.8;margin:0 0 16px;font-weight:600}
.aca-manual-detail p{font-size:14px;line-height:1.9;margin:8px 0}
.aca-manual-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.aca-manual-detail-card{border:1px solid #dce3eb;border-radius:12px;padding:22px;background:#fff;margin-bottom:20px;min-width:0}
.aca-manual-detail dl{margin:0;display:grid;grid-template-columns:minmax(90px,auto) minmax(0,1fr);gap:12px 16px}
.aca-manual-detail dt{color:#52645a;font-size:13px;font-weight:400}.aca-manual-detail dd{margin:0;overflow-wrap:anywhere}
.aca-manual-detail .aca-agent-table{min-width:0}.aca-manual-detail .aca-agent-table th,.aca-manual-detail .aca-agent-table td{font-size:14px;padding:13px 10px;line-height:1.9}
.aca-manual-detail .aca-manual-cost-breakdown{display:block;margin-top:20px}.aca-manual-cost-breakdown>div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:12px;border-bottom:1px solid #edf0ee}.aca-manual-cost-breakdown dt{font-size:14px}.aca-manual-cost-breakdown dd{font-weight:500;text-align:left}
.aca-manual-cost-breakdown .aca-manual-grand-total{background:#edf5ef;border-radius:8px;margin-top:10px;color:#245b36}.aca-manual-grand-total dt,.aca-manual-grand-total dd{font-size:16px;font-weight:600;color:inherit}
.aca-manual-postpaid{padding:16px;background:#fff8eb;border:1px solid #eedcba;border-radius:8px;margin-top:20px}.aca-manual-status{display:inline-block;background:#edf5ef;border:1px solid #dce6df;border-radius:8px;padding:7px 12px;font-size:13px}.aca-manual-detail-muted{color:#52645a}
.aca-manual-timeline{list-style:none;padding:0;margin:18px 0 0}.aca-manual-timeline li{padding:16px 18px;margin-bottom:12px;border:1px solid #e2e8f0;border-right:3px solid #739581;border-radius:8px;background:#fafcfb}.aca-manual-timeline header{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.aca-manual-timeline h4{font-size:15px;line-height:1.8;margin:0;font-weight:600}.aca-manual-timeline time{font-size:13px;color:#52645a}
@media(max-width:650px){.aca-manual-detail-grid{grid-template-columns:1fr}.aca-manual-detail-card{padding:16px}.aca-manual-detail dl{grid-template-columns:1fr;gap:4px}.aca-manual-detail dd{margin-bottom:8px}.aca-manual-detail .aca-agent-table{min-width:560px}.aca-manual-detail .aca-agent-table-wrap{overflow-x:auto}.aca-manual-cost-breakdown>div{flex-direction:column;gap:4px}.aca-manual-detail-header{align-items:flex-start;flex-direction:column}}

.aca-workflow .aca-payment-deadline{margin:18px 0;padding:16px 20px;border:1px solid #dce3eb;border-radius:10px;background:#f8fafc;color:#334155;font-size:14px;line-height:1.9}
.aca-workflow .aca-payment-deadline p{margin:0 0 6px;font-size:inherit;line-height:inherit}
.aca-workflow .aca-payment-deadline p:last-child{margin-bottom:0}

/* Shipment fields share the existing workflow scale and stay inside their section. */
.aca-workflow .aca-shipment-form{min-width:0;margin:20px 0;padding:18px;border:1px solid #dce4ef;border-radius:12px;background:#f8fafc}
.aca-workflow .aca-shipment-form legend{padding:0 8px;font-size:15px;font-weight:700;line-height:1.7}
.aca-workflow .aca-shipment-form p{font-size:13px;line-height:1.9;margin:0 0 16px;color:#526176}
.aca-workflow .aca-shipment-form [hidden]{display:none!important}
.aca-workflow .aca-shipment-form textarea{min-height:72px;resize:vertical}
.aca-workflow .aca-shipment-form>label{margin-top:14px}
.aca-workflow .aca-shipment-form input[type=time]{direction:ltr;text-align:right}
.aca-workflow .aca-shipment-summary h3{font-size:17px;margin:0}
.aca-workflow .aca-shipment-correction{border-top:1px solid #dce4ef;padding-top:12px}
@media(max-width:640px){.aca-workflow .aca-shipment-form{padding:14px}}

.aca-workflow .aca-shipment-history{padding-inline-start:22px}.aca-workflow .aca-shipment-history p{white-space:pre-line;overflow-wrap:anywhere}
.aca-order-editor [hidden] { display: none !important; }
.aca-order-editor { max-width: 1100px; margin: 20px auto; }

/* Separate the business date from the immutable entry timestamp in both workflow panels. */
.aca-workflow .aca-manual-history{margin:16px 0 20px;padding:16px;border:1px solid #dce4ef;border-radius:10px;background:#f8fafc;color:#334155}
.aca-workflow .aca-manual-history-title{display:block;margin:0 0 12px;font-size:14px;line-height:1.8}
.aca-workflow .aca-manual-history-dates{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:0}
.aca-workflow .aca-manual-history-dates>div{min-width:0;padding:14px 16px;border:1px solid #dce4ef;border-radius:8px;background:#fff}
.aca-workflow .aca-manual-history dt{margin:0;font-size:12px;line-height:1.8;color:#526176;font-weight:400}
.aca-workflow .aca-manual-history dd{margin:4px 0 0;line-height:1.8;overflow-wrap:anywhere}
.aca-workflow .aca-manual-history-dates dd{font-size:16px;font-weight:700;color:#172236}
.aca-workflow .aca-manual-history-dates .aca-manual-history-hint{font-size:12px;font-weight:400;color:#526176}
.aca-workflow .aca-manual-history-notes{display:flex;flex-wrap:wrap;gap:12px 28px;margin:14px 0 0;padding-top:12px;border-top:1px solid #dce4ef}
.aca-workflow .aca-manual-history-notes>div{flex:1 1 210px;min-width:0}
.aca-workflow .aca-manual-history-notes dd{font-size:13px;white-space:pre-line}
@media(max-width:480px){.aca-workflow .aca-manual-history{padding:12px}.aca-workflow .aca-manual-history-dates{grid-template-columns:1fr}}
