/* استایل‌های پایه برای تمامی جدول‌ها */
.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
  text-align: right;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fa;
  font-weight: 600;
}

.table tbody + tbody {
  border-top: 2px solid #dee2e6;
}

.table .table {
  background-color: #fff;
}

.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* استایل‌های badge در جدول */
.table .badge {
  display: inline-block;
  padding: 5px 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
}

/* ریسپانسیو برای تبلت (صفحات متوسط) */
@media (max-width: 991.98px) {
  .table-responsive {
    overflow-x: auto;
  }
  
  /* کاهش padding در اندازه‌های متوسط */
  .table th, 
  .table td {
    padding: 20px 0;
  }
}

/* ریسپانسیو برای موبایل (صفحات کوچک) */
@media (max-width: 767.98px) {
  /* تبدیل جدول به کارت */
  .table thead {
    display: none;
  }
  
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }
  
  .table tr {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  }
  
  .table td {
    padding-left: 50%;
    position: relative;
    border-bottom: 1px solid #e9ecef;
    border-top: none;
  }
  
  .table td:last-child {
    border-bottom: 0;
  }
  
  /* اضافه کردن label برای هر سلول */
  .table td::before {
    content: attr(data-label);
    position: absolute;
    right: 0.75rem;
    width: 45%;
    padding-right: 0.75rem;
    font-weight: 600;
    text-align: right;
    color: #495057;
  }
  
  /* استایل‌های دکمه‌ها در حالت موبایل */
  .table .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    margin-left: 0;
  }
  
}