/* تجاوب واجهة الإدارة — الهاتف / التابلت / الشاشات الكبيرة */
html { -webkit-text-size-adjust: 100%; }

@media (max-width: 991.98px) {
  .app-body .main,
  .app-body .container-fluid,
  .container-fluid {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }

  .card-body { padding: .9rem; }

  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn-group.flex-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .35rem;
  }
  .btn-group.flex-wrap > .btn {
    margin: 0 !important;
    border-radius: .25rem !important;
  }

  /* جداول CRUD */
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length {
    text-align: right !important;
    float: none !important;
    width: 100%;
    margin-bottom: .5rem;
  }
  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin: 0 !important;
  }

  .navbar-laravel .container,
  .app-header {
    flex-wrap: wrap;
  }

  /* نماذج */
  .form-inline {
    display: block !important;
  }
  .form-inline .form-control,
  .form-inline .btn {
    width: 100%;
    margin: 0 0 .5rem 0 !important;
  }

  h1, h2, .h1, .h2 { font-size: 1.35rem; }
  h3, .h3 { font-size: 1.2rem; }
  h4, .h4 { font-size: 1.1rem; }
}

@media (max-width: 575.98px) {
  .btn { white-space: normal; }
  .card h2 { font-size: 1.5rem; }
  .modal-dialog { margin: .5rem; }
  .breadcrumb { font-size: .8rem; flex-wrap: wrap; }

  /* أعمدة الجداول الضيقة */
  .table td, .table th {
    white-space: nowrap;
    vertical-align: middle;
  }
}

/* شريط تنقل الحوكمة */
.gov-nav-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .25rem;
  max-width: 100%;
}
.gov-nav-scroll > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* البريد الداخلي */
@media (max-width: 767.98px) {
  .gov-mail-folders { margin-bottom: 1rem; }
}

/* لوحة التحكم الرئيسية */
.home-modules .home-module-card .home-stat-val {
  word-break: break-word;
}
@media (max-width: 575.98px) {
  .home-module-links .btn { display: inline-block; margin: .15rem !important; }
}

/* إصلاحات عامة RTL على الشاشات الصغيرة */
body {
  overflow-x: hidden;
}
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}
.sidebar .nav-dropdown-items .nav-link {
  white-space: normal;
}
