/* Special Entries report layout and modal styling */

/* Desktop/tablet default: table-like layout so header cells align with data cells */
.tpw-spfx-entries .table-container { display: table; width: 100%; border-collapse: collapse; }
.tpw-spfx-entries .table-row { display: table-row; }
.tpw-spfx-entries .table-row .table-cell { display: table-cell; padding: 8px 10px; vertical-align: top; word-break: normal;}
.tpw-spfx-entries .table-head .table-cell { font-weight: 700; }
/* Tidy Paid column */
.tpw-spfx-entries .table-head .table-cell:last-child,
.tpw-spfx-entries .table-row .table-cell:last-child { width: 80px; text-align: center; }
.tpw-spfx-entries .table-row .table-cell:last-child input[type="checkbox"] { margin: 0 auto; display: block; }

/* Keep Member name on one line with ellipsis by default */
.tpw-spfx-entries .table-row .table-cell.member-cell .tpw-member-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: normal;
}

/* Add space between header buttons and the entries table */
.tpw-spfx-entries { margin-top: 16px; }

/* Responsive stack for mobile & tablet: show labels before values */
@media (max-width: 1024px) {
  .tpw-spfx-entries .table-head { display: none; }
  .tpw-spfx-entries .table-container { display: block; width: 100%; }
  .tpw-spfx-entries .table-row { display: block; border-bottom: 1px solid #e5e5e5; padding: 10px 12px; }
  .tpw-spfx-entries .table-row:last-child { border-bottom: 0; }
  .tpw-spfx-entries .table-row .table-cell { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px; }
  .tpw-spfx-entries .table-row .table-cell::before { content: attr(data-label) ":"; font-weight: 700; color: #333; min-width: 130px; }
  .tpw-spfx-entries .table-row .table-cell a { word-break: break-word; }
  /* In mobile flex rows, allow the member link to ellipsize */
  .tpw-spfx-entries .table-row .table-cell.member-cell .tpw-member-link { flex: 1 1 auto; min-width: 0; }
  /* Ensure header stays hidden despite .table-row display override */
  .tpw-spfx-entries .table-head { display: none !important; }
}

/* Member details modal */
#tpw-member-modal.tpw-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); align-items: center; justify-content: center; z-index: 1000; }
#tpw-member-modal .tpw-modal { background: #fff; border-radius: 8px; max-width: 520px; width: 92%; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
#tpw-member-modal .tpw-modal header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #e5e5e5; }
#tpw-member-modal .tpw-modal header .close { background: none; border: 0; font-size: 20px; cursor: pointer; }
#tpw-member-modal .tpw-modal .tpw-modal-body { padding: 16px; }
