/* ── Member list article ────────────────────────────────────────────────── */

#memberList {
  margin-top: 0;
}

/* ── Table toolbar (search + count row) ─────────────────────────────────── */

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.table-toolbar .search-input {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.table-result-count {
  font-size: 0.8125rem;
  color: #888;
  white-space: nowrap;
  margin-left: auto;
}

/* ── Wrapper handles horizontal scroll ───────────────────────────────────── */

#memberList .table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Table base ──────────────────────────────────────────────────────────── */

#memberList table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.875rem;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

#memberList thead {
  background: #265587;
  color: #fff;
}

#memberList th {
  padding: 0.65rem 0.9rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: #265587;
  z-index: 1;
}

.env--local #memberList thead,
.env--local #memberList th {
  background: #3a3a3a;
}

/* ── Sortable header ─────────────────────────────────────────────────────── */

#memberList th.th--sortable {
  cursor: pointer;
  user-select: none;
}

#memberList th.th--sortable:hover {
  background: #1e4a78;
}

.sort-icon {
  font-style: normal;
  opacity: 0.7;
  margin-left: 0.2em;
}

/* ── Body rows ───────────────────────────────────────────────────────────── */

#memberList td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
  white-space: nowrap;
}

#memberList tbody tr:last-child td {
  border-bottom: none;
}

#memberList tbody tr:hover td {
  background: #f5f8ff;
}

/* ── Lapsed row ──────────────────────────────────────────────────────────── */

.tr--lapsed td {
  background: #fffbeb !important;
  color: #92400e;
}

.tr--lapsed:hover td {
  background: #fef3c7 !important;
}

/* ── Status badges ───────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--rsli   { background: #dbeafe; color: #1e40af; }
.badge--tsli   { background: #dcfce7; color: #166534; }
.badge--unreg  { background: #f3f4f6; color: #6b7280; }

.badge--yes    { background: #dcfce7; color: #166534; }
.badge--no     { background: #f3f4f6; color: #6b7280; }

/* ── Empty state ─────────────────────────────────────────────────────────── */

.table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

.table-empty__icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.table-empty__text {
  font-size: 0.9375rem;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */

.actions-cell {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

button.edit-btn,
button.delete-btn {
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.775rem;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

button.edit-btn {
  background: #f4f0e0;
  color: #7c6200;
}

button.edit-btn:hover {
  background: #ebe4c0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

button.delete-btn {
  background: #fee2e2;
  color: #991b1b;
}

button.delete-btn:hover {
  background: #fecaca;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Skeleton loading ────────────────────────────────────────────────────── */

.skeleton-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.skeleton-table thead {
  background: #265587;
}

.env--local .skeleton-table thead {
  background: #3a3a3a;
}

.skeleton-table th {
  padding: 0.65rem 0.9rem;
}

.skeleton-table td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.skeleton-table tbody tr:nth-child(even) td {
  background: #f9f9f9;
}

.skeleton-cell {
  height: 0.875rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8eaed 25%, #f4f4f4 50%, #e8eaed 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-cell--header {
  height: 0.875rem;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
