/* ---------------------------------------------------------------
   ملف: static/css/app.css
   شنو هو: تنسيقات النظام الخاصة فوق Bootstrap.
   القواعد: الموبايل أولاً (360px)، وكل المسافات منطقية (inline-start/end)
   حتى الاتجاه ينعكس وحده بين العربي والإنگليزي (سكل bilingual-rtl-ui).
   --------------------------------------------------------------- */

/* الخط: خطوط النظام الشائعة الي تدعم العربي، بدون تحميل خط من النت. */
body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

/* مسافة تحت المحتوى حتى ما يختفي ورا شريط الآيفون السفلي. */
.app-main {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

/* الأرقام: عرض ثابت لكل رقم حتى الجداول تصطف، واتجاه من اليسار لليمين. */
.num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* الأزرار والروابط المهمة: أقل حجم للمس 44 بكسل (سكل mobile-first-ui). */
.btn {
  min-height: 44px;
}

/* محرر كليشة العقد: مساحة كتابة مريحة، وشكل قريب من الورقة المطبوعة. */
.contract-editor {
  min-height: 50vh;
  background: #fff;
  line-height: 1.9;
  outline: none;
}
.contract-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(25, 135, 84, 0.35);
}
.contract-editor table {
  border-collapse: collapse;
  width: 100%;
}
.contract-editor td,
.contract-editor th {
  border: 1px solid #adb5bd;
  padding: 0.25rem 0.5rem;
}

/* أزرار الأدوات الصغيرة بشريط المحرر: نفس حد اللمس. */
.btn-sm {
  min-height: 44px;
  min-width: 44px;
}

/* شريط المندوب السفلي بالموبايل (S20): ثابت تحت، فوق شريط الآيفون، وكل زر
   بعرض متساوي وارتفاع 56 بكسل. */
.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  background: #fff;
  border-top: 1px solid #dee2e6;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1 1 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #495057;
  text-decoration: none;
  font-weight: 600;
}
.bottom-nav a.active {
  color: #0f5132;
  box-shadow: inset 0 3px 0 #0f5132;
}
/* مسافة تحت المحتوى حتى ما يختفي ورا الشريط السفلي. */
@media (max-width: 767.98px) {
  .app-main.has-bottom-nav {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}
