/* KIRAN OMS Premium UI V4 — Phase 4 */
.p4-smart-input{padding-right:26px!important;background-image:linear-gradient(45deg,transparent 50%,#64748b 50%),linear-gradient(135deg,#64748b 50%,transparent 50%)!important;background-position:calc(100% - 13px) 50%,calc(100% - 9px) 50%!important;background-size:4px 4px,4px 4px!important;background-repeat:no-repeat!important}
.p4-smart-input:focus,.p4-smart-active{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.09)!important;background-color:#fff!important}
.p4-smart-list{display:none;position:fixed;z-index:12050;background:#fff;border:1px solid #cbd5e1;border-radius:12px;box-shadow:0 18px 45px rgba(15,23,42,.22);overflow:hidden;color:#172033;font-family:Inter,system-ui,sans-serif}
.p4-smart-list.open{display:block}
.p4-smart-head,.p4-cd-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;background:#f8fafc;border-bottom:1px solid #e2e8f0;font-size:10px;color:#64748b;position:sticky;top:0;z-index:1}
.p4-smart-head>span:first-child,.p4-cd-head b{font-size:11px;color:#334155;font-weight:800}
.p4-smart-items{max-height:282px;overflow:auto;padding:4px}
.p4-smart-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 9px;border-radius:8px;cursor:pointer;font-size:12px}
.p4-smart-item:hover,.p4-smart-item.is-active{background:#eff6ff;color:#1d4ed8}
.p4-smart-item>div{min-width:0}.p4-smart-item b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.p4-smart-item small{display:block;color:#94a3b8;font-size:9.5px;margin-top:2px}.p4-smart-item>span{display:flex;gap:4px;flex-shrink:0}
.p4-smart-item em,.p4-mini-tag{font-style:normal;font-size:8.5px;padding:2px 5px;border-radius:999px;background:#ecfdf5;color:#047857;font-weight:800;white-space:nowrap}.p4-smart-item em.recent,.p4-mini-tag.recent{background:#fff7ed;color:#c2410c}.p4-smart-item em.recommended{background:#eff6ff;color:#1d4ed8}
.p4-smart-empty{padding:16px 12px;color:#94a3b8;text-align:center;font-size:11px}
.p4-smart-add,.p4-cd-add{display:block;width:100%;border:0;border-top:1px solid #e2e8f0;background:#f8fafc;color:#2563eb;font-weight:800;font-size:11px;text-align:left;padding:9px 11px;cursor:pointer}.p4-smart-add:hover,.p4-cd-add:hover{background:#eff6ff}
/* legacy quick-entry dropdown gets Phase-4 intelligence */
#cd-list{border-radius:10px!important;box-shadow:0 16px 38px rgba(15,23,42,.22)!important;overflow:hidden!important}
#cd-list .cd-item{gap:6px!important}.p4-mini-tag{margin-left:3px}
/* add master */
.p4-add-modal{display:none;position:fixed;inset:0;z-index:13000;background:rgba(15,23,42,.38);backdrop-filter:blur(2px);align-items:center;justify-content:center}.p4-add-modal.open{display:flex}
.p4-add-card{width:410px;max-width:92vw;background:#fff;border-radius:15px;box-shadow:0 24px 70px rgba(15,23,42,.28);overflow:hidden;border:1px solid #e2e8f0}
.p4-add-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid #e2e8f0;background:#f8fafc;color:#1e293b}.p4-add-head button{border:0;background:transparent;font-size:17px;cursor:pointer;color:#64748b}
.p4-add-body{padding:16px}.p4-add-body label{display:block;font-size:10px;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.05em;margin:10px 0 5px}.p4-add-body input{width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:9px 10px;font:13px Inter,system-ui,sans-serif;outline:none}.p4-add-body input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.p4-add-status{min-height:18px;margin-top:10px;font-size:11px;color:#64748b}.p4-add-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid #e2e8f0;background:#f8fafc}
/* Order modal redesign */
.p4-order-modal .p4-order-box{width:min(1040px,96vw)!important;max-height:94vh!important;border-radius:16px!important;box-shadow:0 26px 80px rgba(15,23,42,.34)!important}
.p4-order-modal .mhd{position:sticky;top:0;z-index:6;background:#fff!important;border-bottom:1px solid #e2e8f0!important;padding:14px 18px!important}.p4-order-modal .mhd-t{font-size:16px!important;color:#172033!important}
.p4-order-body{padding:14px 18px 18px!important;background:#f8fafc}.p4-section-title{display:flex;align-items:center;gap:6px;margin:9px 0 7px;color:#475569;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.07em}.p4-order-grid{background:#fff;border:1px solid #e2e8f0;border-radius:11px;padding:11px;margin-bottom:8px!important;gap:9px!important}.p4-order-grid .fg-lb{font-size:9.5px!important;color:#64748b!important;text-transform:uppercase;letter-spacing:.035em}.p4-order-grid .fi{background:#fff!important;border-color:#dbe3ee!important;padding:8px 9px!important}.p4-order-grid .fi:focus{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.07)}
.p4-order-grid.p4-grid4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.p4-order-intel{display:flex;align-items:center;justify-content:space-between;gap:10px;background:linear-gradient(90deg,#eff6ff,#f8fafc);border:1px solid #bfdbfe;border-radius:10px;padding:9px 11px;margin:3px 0 10px;color:#1e3a8a;font-size:11px}.p4-order-intel div{display:flex;flex-direction:column;gap:2px}.p4-order-intel small{color:#64748b}.p4-order-intel button{border:1px solid #93c5fd;background:#fff;color:#1d4ed8;border-radius:7px;padding:5px 8px;font-size:10px;font-weight:800;cursor:pointer;white-space:nowrap}.p4-order-intel button:hover{background:#dbeafe}
.p4-size-wrap{background:#fff!important;border:1px solid #e2e8f0!important;border-radius:11px!important;margin-top:4px!important;overflow:hidden}.p4-size-wrap .sz-hd{background:#f8fafc!important;border-bottom:1px solid #e2e8f0!important;color:#475569!important}.p4-size-wrap .sz-grid{padding:8px!important}.p4-size-wrap .sz-b input{border-color:#dbe3ee!important;background:#fff!important}
.p4-order-foot{position:sticky;bottom:0;z-index:6;background:#fff!important;border-top:1px solid #e2e8f0!important;box-shadow:0 -8px 22px rgba(15,23,42,.06);padding:11px 18px!important}.p4-quick-entry-btn{margin-right:auto!important}
/* Quick row visibility */
.ar-row .p4-smart-input{background-color:#fff!important}.ar-row .p4-smart-input:focus{box-shadow:inset 0 0 0 1px #2563eb,0 0 0 2px rgba(37,99,235,.08)!important}
@media(max-width:900px){.p4-order-grid.p4-grid4{grid-template-columns:repeat(2,minmax(0,1fr))!important}.p4-order-modal .p4-order-box{width:97vw!important}.p4-order-intel{align-items:flex-start;flex-direction:column}.p4-order-intel button{width:100%}}
@media(max-width:620px){.p4-order-grid,.p4-order-grid.p4-grid4{grid-template-columns:1fr!important}.p4-smart-list{width:min(92vw,360px)!important}.p4-order-body{padding:10px!important}.p4-section-title{margin-top:7px}}
@media print{.p4-smart-list,.p4-add-modal{display:none!important}}
