:root {
  --bg: #ffffff;
  --panel-border: #e5e7eb;
  --text-primary: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --link: #2563eb;
  --pill-active-bg: #111827;
  --pill-active-text: #ffffff;
  --pill-inactive-bg: #f3f4f6;
  --pill-inactive-text: #6b7280;
  --pill-outline-bg: #ffffff;
  --pill-outline-border: #d1d5db;
  --pill-outline-text: #374151;
  --row-hover: #fafafa;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --focus-ring: #93c5fd;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  padding: 20px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------- controls row ---------- */

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-field {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 7px 12px;
  min-width: 0;
}

.search-field .icon-search {
  color: var(--text-faint);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.search-field input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  min-width: 0;
  background: transparent;
}

.search-field input::placeholder {
  color: var(--text-faint);
}

.select-field {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  flex: 0 1 150px;
  min-width: 110px;
}

.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reset-btn:hover {
  background: #f9fafb;
  border-color: #c7cdd6;
}

.search-field:focus-within,
.select-field:focus,
.reset-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
  border-color: var(--link);
}

/* ---------- meta row ---------- */

.meta-row {
  margin: 16px 2px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- table (desktop) ---------- */

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--panel-border);
}

.member-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.member-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: none;
  color: var(--text-primary);
  padding: 8px 8px;
  border-bottom: 1px solid var(--panel-border);
  white-space: nowrap;
}

.member-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.member-table tbody tr {
  cursor: pointer;
}

.member-table tbody tr:hover {
  background: var(--row-hover);
}

.member-table tbody tr:last-child td {
  border-bottom: none;
}

.company-link {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
}

.company-link:hover {
  text-decoration: underline;
}

.muted-cell {
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.6;
}

.pill-active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
}

.pill-inactive {
  background: var(--pill-inactive-bg);
  color: var(--pill-inactive-text);
}

.pill-outline {
  background: var(--pill-outline-bg);
  color: var(--pill-outline-text);
  border: 1px solid var(--pill-outline-border);
}

/* ---------- card list (mobile) ---------- */

.card-list {
  display: none;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--panel-border);
  padding-top: 12px;
}

.member-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
}

.member-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.member-card-head .company-link {
  font-size: 14.5px;
}

.member-card-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 6px;
  column-gap: 10px;
  font-size: 13px;
}

.member-card-grid dt {
  color: var(--text-muted);
}

.member-card-grid dd {
  margin: 0;
  color: var(--text-primary);
  text-align: right;
}

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--panel-border);
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
}

.page-nav:hover:not(:disabled) {
  background: #f9fafb;
}

.page-nav:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 6px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13.5px;
}

.page-btn:hover {
  background: #f9fafb;
}

.page-btn.active {
  background: var(--pill-active-bg);
  border-color: var(--pill-active-bg);
  color: #fff;
}

.page-ellipsis-btn {
  color: var(--text-faint);
}

.page-jump-input {
  width: 42px;
  height: 32px;
  border: 1px solid var(--link);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
}

.page-jump-input::-webkit-outer-spin-button,
.page-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .wrap {
    padding: 12px;
  }

  .panel {
    padding: 14px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field,
  .select-field,
  .reset-btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .card-list {
    display: flex;
  }

  .pagination {
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .page-numbers .page-btn:nth-child(n+5) {
    display: none;
  }
}

/* ---------- modal detail anggota ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.2); 
  backdrop-filter: blur(8px); 
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay:not([hidden]) {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-group h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-company-block {
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.modal-company-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.modal-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-kta {
  font-size: 13px;
  color: var(--text-faint);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-box {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-box:empty::before {
  content: "Tidak ada data";
  color: var(--text-faint);
}

.modal-box-stacked .modal-box-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.modal-box-stacked > div:last-child:empty::before {
  content: "Tidak ada data";
  color: var(--text-faint);
}

.modal-footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
  border-top: 1px solid var(--panel-border);
  padding-top: 14px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 18px;
  }
}
