
/* ============================================================
   R31.20 — TYPOGRAPHY & TEXT SPACING SYSTEM
   Loaded last on every HTML page.
   ============================================================ */

@font-face{
  font-family:"AndishehUI";
  src:url("/static/fonts/andisheh-ui.woff2") format("woff2");
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
}

html[lang="fa"],
html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] body *:not(svg):not(path){
  font-family:"AndishehUI",Tahoma,"Segoe UI",Arial,sans-serif!important;
  letter-spacing:0!important;
}

/* Prevent visual text collision caused by compressed inline/flex items. */
nav,
.top-actions,
.parent-actions,
.footer-links>div,
.hero-actions,
.registration-role-pages,
.account-tabs{
  column-gap:10px!important;
  row-gap:8px!important;
}

nav a,
nav button,
.top-actions>*,
.parent-actions>*,
.footer-links a,
.hero-actions a,
.registration-role-pages button,
.account-tabs button{
  white-space:nowrap!important;
}

/* Generic readable spacing for text-bearing controls. */
button,
.btn,
.icon-btn,
a,
label,
.status,
.badge,
.role-chip,
.sync-status,
.soft-pill{
  text-rendering:optimizeLegibility!important;
}

/* Avoid text clipping in common labels/cards. */
h1,h2,h3,h4,h5,h6,p,small,b,strong,span,label,td,th{
  overflow-wrap:break-word;
}

.side-nav button,
.side-nav a{
  line-height:1.65!important;
}

.top-actions,
.parent-actions{
  min-width:0!important;
  max-width:100%!important;
}

/* Consistent semantic text contrast */
.status.ok,.success,.badge.success,
[data-state="active"],[data-state="paid"]{
  color:#e8fff5!important;
}
.status.warn,.notice,.badge.warning,
[data-state="pending"],[data-state="warning"]{
  color:#fff0c9!important;
}
.status.bad,.error,.badge.danger,
[data-state="danger"],[data-state="overdue"]{
  color:#ffe7e9!important;
}
.status.info,.badge.info{
  color:#e6f7ff!important;
}

/* Mobile: never let text-only action rows create a page-wide horizontal scrollbar. */
@media(max-width:900px){
  .top-actions,
  .parent-actions,
  nav{
    max-width:100%!important;
  }
}
