/* جدول فاتورة الشراء - أعمدة قابلة للتكبير/التصغير + تمرير أفقي */

.purchase-entry-table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.purchase-entry-table-wrapper table {
  table-layout: fixed;
  min-width: 100%;
  width: auto;
  margin-bottom: 0;
  border-collapse: collapse;
}

.purchase-entry-table-wrapper table thead th {
  position: relative;
  min-width: 50px;
  white-space: nowrap;
  padding: 10px 20px 10px 10px;
  vertical-align: middle;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

/* إلغاء عرض Bootstrap/Tailwind (col-md-*) داخل الجدول لتمكين التصغير بحرية */
.purchase-entry-table-wrapper table thead th[class*="col-"] {
  width: auto;
  max-width: none;
}

/* العمود الأخير (حذف/إجراءات) فقط بعرض ثابت */
.purchase-entry-table-wrapper table thead th:last-child {
  width: 44px;
  min-width: 44px;
  max-width: 50px;
}

/* مقبض تغيير عرض العمود - LTR: من اليمين */
.purchase-entry-table-wrapper .col-resize-handle {
  position: absolute;
  right: 0;
  left: auto;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
}

.purchase-entry-table-wrapper .col-resize-handle:hover,
.purchase-entry-table-wrapper .col-resize-handle.col-resize-active {
  background: rgba(0, 123, 255, 0.15);
}

.purchase-entry-table-wrapper .col-resize-handle::after {
  content: '';
  position: absolute;
  right: 3px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 20px;
  background: #dee2e6;
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s;
}

.purchase-entry-table-wrapper thead th:hover .col-resize-handle::after,
.purchase-entry-table-wrapper .col-resize-handle.col-resize-active::after {
  opacity: 1;
  background: #007bff;
}

/* العربية RTL: المقبض من يسار العمود */
[dir="rtl"] .purchase-entry-table-wrapper .col-resize-handle {
  left: 0;
  right: auto;
}

[dir="rtl"] .purchase-entry-table-wrapper .col-resize-handle::after {
  left: 3px;
  right: auto;
}

.purchase-entry-table-wrapper table tbody td {
  padding: 8px 10px;
  vertical-align: middle;
  border: 1px solid #dee2e6;
}

/* منع تحديد النص أثناء السحب */
.purchase-entry-table-wrapper.col-resizing {
  user-select: none;
  -webkit-user-select: none;
}

.purchase-entry-table-wrapper.col-resizing * {
  cursor: col-resize !important;
}
