/* TEDY ERP R4 final UX hardening */
html[data-tedy-release="V29.3.0-R4"] body{overscroll-behavior-y:none}
.r4-release-badge{font-size:.72rem;font-weight:800;padding:.25rem .5rem;border-radius:999px;border:1px solid currentColor}
.form-grid select,.form-grid input,.form-grid textarea{max-width:100%;min-width:0}
.form-grid .field{min-width:0}
.temp-password{user-select:none;letter-spacing:.2em;filter:none!important}
#r4GuardianScan pre{max-height:320px;overflow:auto;white-space:pre-wrap;word-break:break-word;font-size:.78rem}
@media(max-width:760px){
  .page-head{align-items:flex-start!important;gap:10px!important}
  .page-head .actions{width:100%;display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .page-head .actions>.btn{width:100%!important;min-height:44px}
  .form-grid{grid-template-columns:minmax(0,1fr)!important;padding-bottom:calc(110px + env(safe-area-inset-bottom))!important}
  .form-grid .field.full,.form-grid .field{grid-column:1!important}
  .modal{max-height:94dvh!important;overflow:auto!important;padding-bottom:env(safe-area-inset-bottom)!important}
  .sticky-form-actions{position:sticky!important;bottom:0!important;z-index:8!important;background:var(--panel,#fff)!important;padding:10px 0 calc(10px + env(safe-area-inset-bottom))!important}
  .table-wrap{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .kpi,.card,.product-card{min-width:0!important;overflow-wrap:anywhere}
}

/* R4.1 mobile label collision hotfix — sales/nav text must never overlap icons or adjacent labels. */
@media(max-width:900px){
  .mobile-bottom{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    overflow:visible!important;
  }
  .mobile-bottom button{
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    min-width:0!important;
    max-width:100%!important;
    min-height:60px!important;
    padding:5px 1px!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    line-height:1.15!important;
    font-size:9px!important;
    text-align:center!important;
  }
  .mobile-bottom button b{
    display:block!important;
    flex:0 0 auto!important;
    font-size:18px!important;
    line-height:1!important;
    margin:0 0 2px!important;
  }
  .mobile-bottom button[data-page="sales"]{
    letter-spacing:0!important;
    line-height:1.2!important;
  }
  #nav .nav-btn{
    min-width:0!important;
    align-items:center!important;
  }
  #nav .nav-btn .label{
    min-width:0!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    line-height:1.25!important;
    overflow-wrap:anywhere!important;
  }
}
