
/* ============================================================
   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;
}

/* Keep panel form values readable even when older theme rules conflict. */
html body :is(.app-shell,.wrap) :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]){
  color-scheme:dark!important;
  background:#071b2d!important;
  color:#f7fbff!important;
  -webkit-text-fill-color:#f7fbff!important;
  caret-color:#f7fbff!important;
  border-color:rgba(145,196,226,.58)!important;
}
html body :is(.app-shell,.wrap) :is(input,textarea)::placeholder{
  color:#c5d5e1!important;
  -webkit-text-fill-color:#c5d5e1!important;
  opacity:1!important;
}
html body :is(.app-shell,.wrap) input:-webkit-autofill,
html body :is(.app-shell,.wrap) input:-webkit-autofill:hover,
html body :is(.app-shell,.wrap) input:-webkit-autofill:focus{
  -webkit-text-fill-color:#f7fbff!important;
  -webkit-box-shadow:0 0 0 1000px #071b2d inset!important;
  caret-color:#f7fbff!important;
}
html body :is(.app-shell,.wrap) option{background:#071b2d!important;color:#f7fbff!important}

/* The Smart School link must stay on one line in the narrow sidebar. */
#smartSchoolNav{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:12px!important}
#smartSchoolNav>span{flex:0 0 30px!important}
#smartSchoolNav>b{display:block!important;flex:1 1 auto!important;min-width:0!important;white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important}
#smartSchoolNav>small{display:none!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;
  }
}
