:root {
  --navy: #1a4d7c;
  --yellow: #fdef11;
  --primary-color: #1a4d7c;
  --white-color: #ffffff;
}

.table-container {
  margin: 50px auto;
  direction: rtl;
  font-family: "iransans", Tahoma, sans-serif;
  width: 30%;
  max-width: 1000px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.custom-table thead {
  background-color: var(--navy);
  color: var(--yellow);
}

.custom-table th {
  padding: 15px 7px;

  text-align: right;
  font-weight: 650;
  border-bottom: 3px solid var(--yellow);
  font-size: 15px;
}

.custom-table td {
  padding: 18px 15px;
  border-bottom: 1px solid #eee;
  color: #333;
  font-size: 12px;
}

.role-title {
  background-color: #f9f9f9;
  font-weight: 600;
  width: 40%;
  color: var(--navy) !important;
}

.custom-table tbody tr:hover {
  background-color: rgba(26, 77, 124, 0.03);
}

.custom-table tbody tr:last-child td {
  border-bottom: none;
}

.btn-download {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-download:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}

/* ------------------------------------------------ */
/* استایل ریسپانسیو (مخصوص موبایل و تبلت‌های کوچک) */
/* ------------------------------------------------ */
@media screen and (max-width: 650px) {
  .table-container {
    width: 100%;
    margin: 20px auto;
    padding: 0 10px;
  }

  .custom-table {
    display: block;
    width: 100%;
    background-color: transparent;
    box-shadow: none;
  }

  .custom-table thead {
    display: none;
  }

  .custom-table tbody {
    display: block;
    width: 100%;
  }

  .custom-table tr {
    display: block;
    width: 100%;
    background-color: #fff;
    border: 1px solid #cc0909;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
  }

  .custom-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    font-size: 13.5px;
  }

  .custom-table td:last-child {
    border-bottom: none;
  }

  .custom-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--navy);
    text-align: right;
    margin-left: 15px;
    white-space: nowrap;
  }

  /* استایل سلول هدر کارت */
  .role-title {
    background-color: #f5f7fa !important;
    border-bottom: 2px solid var(--yellow) !important;
    font-weight: 700;
  }

  .role-title::before {
    color: #555;
  }

  /* نمایش خط تیره در صورت خالی بودن سلول */
  .custom-table td:empty::after {
    content: "—";
    color: #ccc;
  }
}

/* استایل برای عنوان جدید */
.table-heading {
  display: none;
  text-align: center;
  color: var(--navy);
  font-family: "IRANSans";
  margin-bottom: 25px;
  font-size: 28px;
  font-weight: bold;
}

/* ------------------------------------------------ */
/* استایل ریسپانسیو (مخصوص موبایل) */
/* ------------------------------------------------ */
@media screen and (max-width: 650px) {
  /* تغییر اصلی: در موبایل نمایش داده می‌شود */
  .table-heading {
    display: block;
    font-size: 22px;
    margin-bottom: 25px;
  }

  .table-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
  }

  .custom-table {
    display: block;
    background-color: transparent;
    box-shadow: none;
  }

  .custom-table thead {
    display: none;
  }

  .custom-table tbody {
    display: block;
    width: 100%;
  }

  .custom-table tr {
    display: block;
    width: 100%;
    background-color: #fff;
    border: 1px solid #e6ebf0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
  }

  .custom-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    box-sizing: border-box;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
  }

  .custom-table .role-title {
    display: block !important;
    text-align: center !important;
    background-color: #f5f7fa !important;
    border-bottom: 2px solid var(--yellow) !important;
    font-size: 16px !important;
  }

  .custom-table .role-title::before {
    display: none !important;
  }

  .custom-table td:not(.role-title)::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--navy);
    margin-left: 5px;
  }

  .custom-table td:last-child {
    border-bottom: none;
  }

  .custom-table td:empty::after {
    content: "—";
    color: #ccc;
  }
}
