@tailwind base;
@tailwind components;
@tailwind utilities;

/* الخط العام والخلفية */
body {
  font-family: 'Tajawal', sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* التخطيط العام */
.layout {
  display: flex;
  flex-direction: row-reverse;
  min-height: 100vh;
  overflow-x: hidden; /* لمنع التمدد الأفقي العام */
}

/* الشريط الجانبي */
.sidebar {
  width: 250px;
  background-color: #343a40;
  color: #fff;
  height: 100vh;
  overflow-y: auto;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1030;
}

.sidebar a {
  color: #fff;
  display: block;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
  background-color: #495057;
}

/* المنطقة الرئيسية */
.main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-right: 250px;              /* نفس عرض الشريط */
  max-width: calc(100vw - 250px);   /* تمنع التمدد وتثبت العرض */
  overflow-x: auto;                 /* أي سكرول أفقي يكون داخل الـ main فقط */
}

/* الهيدر */
.navbar {
  background-color: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* المحتوى */
.content {
  padding: 20px;
  flex-grow: 1;
  max-width: 100%;
  overflow-x: auto; /* لحصر التمدد داخلها */
}

/* في حال استخدام container-fluid داخل .main */
.main .container-fluid {
  max-width: 100%;
  overflow-x: auto;
}

/* الموبايل */
.sidebar-mobile-toggle {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    right: -250px;
    transition: right 0.3s ease-in-out;
  }

  .sidebar.show {
    right: 0;
  }

  .main {
    margin-right: 0 !important;
    max-width: 100% !important;
  }

  .sidebar-mobile-toggle {
    display: inline-block;
    background: none;
    border: none;
    font-size: 1.5rem;
    margin-left: 10px;
  }
}

/* ملاحظة مهمّة:
   لا نضع أي قواعد خاصة بـ #gl5001 هنا
   حتى لا تؤثر على حجم/عرض الـ sidebar.
   أي تخصيص لصفحة GL Entries يكون داخل
   gl_entries/index.blade.php فقط.
*/
