/* TEDY ERP V29.3.0-R4.13 — regression-safe consolidated UI CSS.
   Replaces R4.7–R4.12 UI-only CSS layers; core workflow guards remain unchanged. */
/* TEDY ERP R4.11 UAT13 consolidated CSS — mobile-first, no behavior loops. */
#mobileBottom,.mobile-bottom{display:none!important;visibility:hidden!important;pointer-events:none!important;height:0!important;overflow:hidden!important}
#r49PurchaseStatus,.r49-purchase-status{display:none!important}
.r411-stale-schema{display:none!important}
html.r411-refreshing #main{opacity:.92}
html.r411-refreshing .topbar:after{content:'እየታደሰ…';font-size:.72rem;opacity:.65;margin-left:auto}
.r411-info{font-size:.82rem;opacity:.82;margin:.25rem 0 .6rem}
.r411-purchase-line{display:grid;grid-template-columns:minmax(220px,2fr) minmax(150px,1.3fr) minmax(90px,.7fr) minmax(110px,.8fr) auto;gap:8px;align-items:end;margin-bottom:10px;padding:10px;border:1px solid rgba(255,255,255,.09);border-radius:12px;background:rgba(255,255,255,.025)}
.r411-material-search{grid-column:1/-1;width:100%;min-height:44px}
.r411-purchase-line select,.r411-purchase-line input{min-width:0;width:100%}
.r411-material-form{align-items:start}
.r411-advanced{grid-column:1/-1;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.025);overflow:hidden}
.r411-advanced>summary{cursor:pointer;padding:.9rem 1rem;font-weight:800;list-style:none;display:flex;justify-content:space-between;align-items:center}
.r411-advanced>summary::-webkit-details-marker{display:none}.r411-advanced>summary:after{content:'＋';opacity:.7}.r411-advanced[open]>summary:after{content:'−'}
.r411-advanced-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0 12px 12px}.r411-advanced-grid>.field{margin:0!important}
.r411-chips{display:flex;flex-wrap:wrap;gap:8px}.r411-chips label{display:inline-flex;align-items:center;gap:6px;padding:.45rem .65rem;border:1px solid rgba(255,255,255,.12);border-radius:999px;background:rgba(255,255,255,.03)}
.r411-request-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}.r411-workflow{margin-bottom:12px}
[data-r411-reqclass][hidden]{display:none!important}
#r411Inspect .notice.ok{line-height:1.55}
#r411SaveMaterial:disabled,#r411SubmitPurchase:disabled,#r4ProgressForm button:disabled,#saleForm button:disabled,#v29SaleForm button:disabled{opacity:.45!important;cursor:not-allowed!important;filter:grayscale(.35)}
.main-wrap,.content,#main{padding-bottom:max(16px,env(safe-area-inset-bottom))!important}
@media(max-width:760px){
  .content,#main{padding-left:10px!important;padding-right:10px!important;padding-bottom:max(18px,env(safe-area-inset-bottom))!important}
  .topbar{min-height:60px!important;padding:8px 10px!important}.topbar-title small{display:none!important}.topbar-actions .branch-pill,.topbar-actions>.pill:not(.topbar-profile){display:none!important}
  .hero{min-height:0!important;padding:16px!important;margin-bottom:10px!important}.workflow{display:none!important}
  .page-head{gap:8px!important;margin-bottom:10px!important}.page-head h1{font-size:1.3rem!important}.card{border-radius:15px!important}.form-grid{gap:9px!important}
  .r411-purchase-line{grid-template-columns:1fr;padding:9px}.r411-material-search{grid-column:auto}.r411-purchase-line .btn.danger{justify-self:end;width:auto}
  .r411-advanced-grid{grid-template-columns:1fr;gap:9px;padding:0 10px 10px}
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.r411-request-filters{position:sticky;top:0;z-index:2;padding:6px 0;background:var(--bg,#031c13)}
}

/* TEDY ERP R4.12 — UAT15 UI consolidation */
html[data-tedy-release="V29.3.0-R4.12"] .r45-prod-note,
html[data-tedy-release="V29.3.0-R4.12"] .r46-bom-link-note{display:none!important}
.r412-submit-last{order:999!important;margin-top:8px!important}
.r412-native-select{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:.001!important;pointer-events:none!important}
.r412-picker{position:relative;width:100%;min-width:0}
.r412-picker-button{width:100%;min-height:48px;text-align:left;padding:11px 42px 11px 12px;border:1px solid rgba(215,179,90,.28);border-radius:12px;background:rgba(0,0,0,.16);color:inherit;font:inherit;position:relative;white-space:normal}
.r412-picker-button:after{content:'⌄';position:absolute;right:14px;top:50%;transform:translateY(-50%);opacity:.7}
.r412-picker-panel{position:absolute;z-index:1200;left:0;right:0;top:calc(100% + 6px);padding:9px;border:1px solid rgba(215,179,90,.35);border-radius:14px;background:#06261a;box-shadow:0 18px 46px rgba(0,0,0,.45);max-height:min(420px,62vh);overflow:hidden}
.r412-picker-search{width:100%;min-height:46px;margin:0 0 8px;padding:10px 12px;border-radius:10px}
.r412-picker-list{display:grid;gap:5px;max-height:min(340px,50vh);overflow:auto;-webkit-overflow-scrolling:touch}
.r412-picker-option{display:block;width:100%;padding:10px 11px;text-align:left;border:1px solid rgba(255,255,255,.08);border-radius:10px;background:rgba(255,255,255,.035);color:inherit;font:inherit;line-height:1.35}
.r412-picker-option.selected{border-color:rgba(50,220,130,.6);background:rgba(25,170,100,.16)}
.r412-picker-empty{padding:16px;text-align:center;opacity:.72}
.r412-readiness-help,.r412-photo-rule{line-height:1.65!important}
.r412-advanced-tools{margin-left:auto;min-width:180px;border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:8px 10px}
.r412-advanced-tools>summary{cursor:pointer;font-weight:700}
.r412-advanced-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}
.r412-prod-status{line-height:1.55}
.r2-feature-strip{font-size:.82rem}
@media(max-width:760px){
  .r412-picker-panel{position:fixed;left:10px;right:10px;top:12vh;max-height:76vh;z-index:99999}
  .r412-picker-list{max-height:60vh}
  .r412-picker-button{min-height:50px}
  .r2-sticky-actions{position:static!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important}
  .r2-sticky-actions>.btn,.r2-sticky-actions>.r412-advanced-tools{width:100%!important;margin:0!important}
  .r412-advanced-actions{flex-direction:column}.r412-advanced-actions .btn{width:100%}
}


/* Sales/POS stable final layout: no overlap, final action last, disabled is visibly disabled. */
.r413-sales-form{position:relative!important;overflow:visible!important;isolation:isolate;padding-bottom:max(1rem,env(safe-area-inset-bottom))!important}
.r413-sales-form .field,.r413-sales-form .field.full,.r413-sales-form input,.r413-sales-form select,.r413-sales-form textarea,.r413-sales-form .notice,.r413-sales-form .card{box-sizing:border-box!important;min-width:0!important;max-width:100%!important}
.r413-sales-form .r413-sale-final-action{position:static!important;float:none!important;clear:both!important;transform:none!important;width:100%!important;max-width:none!important;grid-column:1/-1!important;order:99999!important;margin:1.1rem 0 0!important;padding:1rem 0 max(.45rem,env(safe-area-inset-bottom))!important;border-top:1px solid rgba(255,255,255,.12)!important;background:transparent!important;box-shadow:none!important;z-index:auto!important}
.r413-sales-form .r413-complete-sale{position:static!important;display:block!important;width:100%!important;min-height:52px!important;margin:.65rem 0 0!important;white-space:normal!important;line-height:1.35!important;z-index:auto!important}
.r413-sales-form .r413-complete-sale:disabled,.r413-sales-form .r413-complete-sale[aria-disabled="true"],.r413-sales-form .r413-complete-sale.r413-not-ready{opacity:.38!important;filter:grayscale(.85)!important;cursor:not-allowed!important;pointer-events:none!important;box-shadow:none!important}
.r413-sale-state{margin:.25rem 0 .65rem!important;line-height:1.55!important}
.r413-hide-legacy{display:none!important}
.r413-release-identity{margin:0 0 12px!important;line-height:1.55!important}
.r413-bom-guide{margin:0 0 12px!important;line-height:1.6!important}
.r413-bom-manual{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:0;margin-top:12px;background:rgba(255,255,255,.02)}
.r413-bom-manual>summary{cursor:pointer;font-weight:800;padding:12px 14px;list-style:none}
.r413-bom-manual>summary::-webkit-details-marker{display:none}
.r413-bom-manual>summary:after{content:'＋';float:right;opacity:.7}
.r413-bom-manual[open]>summary:after{content:'−'}
.r413-bom-manual>section{margin:0!important;padding:0 10px 10px}
.r413-shortage-card{line-height:1.35!important}
.r413-shortage-card .table-wrap{max-height:55vh;overflow:auto;-webkit-overflow-scrolling:touch}
.r413-shortage-card table{font-size:.86rem!important}
.r413-shortage-card td,.r413-shortage-card th{padding:.48rem .5rem!important;white-space:normal!important;overflow-wrap:anywhere}
/* Progress-state rules formerly supplied by R4.7 CSS. */
.r47-progress-state{margin-bottom:.65rem;line-height:1.45}
#r4ProgressForm button[disabled],#prodForm button[disabled]{opacity:.5;cursor:not-allowed;filter:grayscale(.2)}
#r4ProgressForm select[name="stage"]{width:100%;min-height:44px}
@media(max-width:760px){
  .r413-sales-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:.72rem!important;width:100%!important}
  .r413-sales-form>*{grid-column:1/-1!important;width:100%!important;margin-left:0!important;margin-right:0!important}
  .r413-sales-form input,.r413-sales-form select,.r413-sales-form textarea,.r413-sales-form button{font-size:16px!important}
  .r413-shortage-card{font-size:.88rem!important}
  .r413-shortage-card .table-wrap{max-height:50vh}
}
