/* ===== table.css — Responsive Table สำหรับ Responsee Framework ===== */
/* Desktop: ใช้สไตล์ตาราง Responsee เดิม
   Mobile (< 768px): แปลงเป็นการ์ด Stack Cards */

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

.responsive-table table {
  width: 100%;
  border-collapse: collapse;
}

/* หัวตาราง */
.responsive-table thead th {
  background: #222 !important;
  color: #fff !important;
  white-space: nowrap;
  font-size: 0.85rem;
  border-right: 1px solid #444 !important;
  text-align: center;
}

/* แถวรวม */
.responsive-table tbody tr:last-child {
  background: #fffde7 !important;
  font-weight: 700;
}

/* ★ ===== Mobile: แปลงเป็นการ์ด ===== */
@media screen and (max-width: 768px) {
  .responsive-table table,
  .responsive-table thead,
  .responsive-table tbody,
  .responsive-table th,
  .responsive-table td,
  .responsive-table tr {
    display: block;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    margin-bottom: 16px;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .responsive-table tbody tr:last-child {
    border-color: #f9a825;
    background: #fffde7 !important;
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid #eee;
    border-right: none !important;
    text-align: right;
    font-size: 0.85rem;
    background: transparent !important;
  }
  .responsive-table td:last-child {
    border-bottom: none;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #555;
    text-align: left;
    font-size: 0.75rem;
    flex: 0 0 90px;
    margin-right: 10px;
  }

  .responsive-table td:nth-child(2) {
    font-weight: 600;
    color: #222;
  }
}
