/* Hamyara 0.15.34 — single-source tree disclosure + category-form layout hardening */

/*
  FINAL TREE DISCLOSURE CONTRACT
  ------------------------------
  The visible sign is an inline SVG inserted by v46.js.  Every older text,
  pseudo-element and span glyph is hidden. This gives one and only one visual
  source for + / − across product categories, parties, expense categories,
  party groups and accounts.
*/
body button:is(.tree-toggle-v159,.tree-toggle-v158){
  position:relative!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 32px!important;
  width:32px!important;height:32px!important;
  min-width:32px!important;max-width:32px!important;
  min-height:32px!important;max-height:32px!important;
  padding:0!important;margin:0!important;
  border-radius:50%!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  font-size:0!important;line-height:0!important;color:transparent!important;
  transform-origin:50% 50%!important;
  transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .12s ease!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)::before,
body button:is(.tree-toggle-v159,.tree-toggle-v158)::after,
body button:is(.tree-toggle-v159,.tree-toggle-v158)>span,
body button:is(.tree-toggle-v159,.tree-toggle-v158)>span::before,
body button:is(.tree-toggle-v159,.tree-toggle-v158)>span::after{
  content:none!important;display:none!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)>.tree-disclosure-svg-v186{
  position:absolute!important;
  display:block!important;
  left:50%!important;top:50%!important;
  width:18px!important;height:18px!important;
  min-width:18px!important;min-height:18px!important;
  margin:0!important;padding:0!important;
  transform:translate(-50%,-50%)!important;
  transform-origin:50% 50%!important;
  overflow:visible!important;
  pointer-events:none!important;
  color:#2f6986!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)>.tree-disclosure-svg-v186 line{
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.4!important;
  stroke-linecap:round!important;
  vector-effect:non-scaling-stroke!important;
  transform-box:fill-box!important;
  transform-origin:center!important;
  transition:opacity .15s ease,transform .18s cubic-bezier(.2,.8,.2,1)!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)>.tree-disclosure-svg-v186 .tree-disclosure-h-v186{
  opacity:1!important;transform:none!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)>.tree-disclosure-svg-v186 .tree-disclosure-v-v186{
  opacity:1!important;transform:scaleY(1)!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158)[aria-expanded="true"]>.tree-disclosure-svg-v186 .tree-disclosure-v-v186{
  opacity:0!important;transform:scaleY(0)!important;
}
body button:is(.tree-toggle-v159,.tree-toggle-v158):hover{transform:scale(1.04)!important}
body button:is(.tree-toggle-v159,.tree-toggle-v158):active{transform:scale(.97)!important}
body button:is(.tree-toggle-v159,.tree-toggle-v158):focus-visible{outline:2px solid #65a9cf!important;outline-offset:2px!important}

/* Never shrink the disclosure on phones; a stable viewBox and shell keep it centred. */
@media(max-width:620px){
  body button:is(.tree-toggle-v159,.tree-toggle-v158){
    flex-basis:32px!important;width:32px!important;height:32px!important;
    min-width:32px!important;max-width:32px!important;min-height:32px!important;max-height:32px!important;
  }
}

/* Category create/edit form: the left summary is a vertical card, not the five-column summary used on list pages. */
body .category-form-v154 .entity-form-grid-v13{
  grid-template-columns:minmax(0,1fr) 310px!important;
  gap:18px!important;
  align-items:start!important;
}
body .category-form-v154 .entity-form-aside-v13{min-width:0!important;width:100%!important}
body .category-form-v154 .category-summary-v154{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:9px!important;
  width:100%!important;
  min-width:0!important;
  padding:18px!important;
  text-align:center!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body .category-form-v154 .category-summary-v154>small,
body .category-form-v154 .category-summary-v154>.summary-label-v154,
body .category-form-v154 .category-summary-v154>p,
body .category-form-v154 .category-summary-v154>.category-level-big-v13{
  width:100%!important;min-width:0!important;margin:0!important;box-sizing:border-box!important;
}
body .category-form-v154 .category-summary-v154>p{
  min-height:44px!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.8!important;
}
body .category-form-v154 .category-summary-v154 .summary-actions-v154{
  display:grid!important;grid-template-columns:1fr!important;gap:9px!important;
  width:100%!important;min-width:0!important;margin-top:6px!important;
}
body .category-form-v154 .category-summary-v154 .summary-actions-v154 .btn{
  width:100%!important;min-width:0!important;max-width:100%!important;
  margin:0!important;padding-inline:12px!important;box-sizing:border-box!important;
  white-space:normal!important;text-align:center!important;
}
@media(max-width:1120px){
  body .category-form-v154 .entity-form-grid-v13{grid-template-columns:1fr!important}
  body .category-form-v154 .entity-form-aside-v13{position:static!important;order:2!important}
  body .category-form-v154 .category-summary-v154{max-width:none!important}
}

/* 0.15.34 QA hardening: on narrow phones the line-total box must keep «ریال» visibly to the left of the amount. */
@media(max-width:680px){
  body.transaction-page .retail-item-main>.retail-line-total{
    grid-template-columns:1fr!important;
    grid-template-rows:auto 52px auto!important;
    min-height:92px!important;
    gap:4px!important;
  }
  body.transaction-page .retail-item-main>.retail-line-total>span,
  body.transaction-page .retail-item-main>.retail-line-total>small{
    height:auto!important;min-height:18px!important;
  }
  body.transaction-page .retail-line-value-v165{
    width:100%!important;min-width:0!important;
    display:flex!important;direction:ltr!important;
    align-items:center!important;justify-content:flex-start!important;
    gap:7px!important;padding-inline:10px!important;
  }
  body.transaction-page .retail-line-value-v165>small{
    position:static!important;left:auto!important;right:auto!important;
    order:0!important;flex:0 0 auto!important;margin:0!important;
  }
  body.transaction-page .retail-line-value-v165>strong{
    order:1!important;flex:0 1 auto!important;margin:0!important;
    text-align:left!important;justify-content:flex-start!important;
  }
}
