/* (10-25) لوحة التحكم على الجوال — بيشتغل بس لما الشاشة ≤ 820px، الكمبيوتر ما بيتغيّر. */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; }
  /* القائمة الجانبية: درج مخفي بيطلع من اليمين بزر ☰ */
  #root > div > aside {
    position: fixed !important; top: 0; bottom: 0; right: 0; height: 100vh !important;
    width: min(80vw, 300px) !important; z-index: 10001; transform: translateX(105%);
    transition: transform .25s ease; box-shadow: -10px 0 30px rgba(0,0,0,.6);
  }
  body.m-nav #root > div > aside { transform: none; }
  #m-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10000; display: none; }
  body.m-nav #m-backdrop { display: block; }
  #m-burger {
    position: fixed; top: 10px; right: 10px; z-index: 9999; width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid #2a3140; background: #161a23; color: #e8b64c; font-size: 22px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.5);
  }
  /* المحتوى بياخد عرض الشاشة كامل */
  #root > div > :not(aside) { width: 100% !important; min-width: 0 !important; max-width: 100vw !important; }
  #root > div > :not(aside) > * { max-width: 100%; }
  main, #root > div > :not(aside) { padding-left: 10px !important; padding-right: 10px !important; }
  /* ترويسة الصفحة: فراغ لزر ☰ */
  #root > div > :not(aside) > :first-child { padding-right: 58px !important; }
  /* الكروت: عمود واحد (أو اتنين للمربعات الصغيرة) بنفس العرض */
  [style*="grid-template-columns"] { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important; }
  [style*="display: flex"][style*="gap"] { flex-wrap: wrap; }
  /* الجداول: بتتمرّر بالعرض، والعمود الأوّل ثابت */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table th:first-child, table td:first-child { position: sticky; right: 0; background: #161a23; z-index: 1; }
  /* أزرار وحقول بحجم الإصبع */
  button, input, select { min-height: 38px; font-size: 14px !important; }
  input, select, textarea { max-width: 100%; }
  img { max-width: 100%; height: auto; }
  /* زر الأدوات الإضافيّة: أصغر بالزاوية وما بيغطّي */
  #xtools-btn { left: 10px !important; bottom: 10px !important; padding: 8px 12px !important; font-size: 12.5px !important; opacity: .95; }
  #xtools-menu { left: 10px !important; right: 10px !important; bottom: 56px !important; min-width: 0 !important; }
}
