.pa-rm-wrap {
  --pa-rm-primary: #056e4f;
  --pa-rm-accent: #ff9900;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  font-family: inherit;
  color: #1e293b;
}

.pa-rm-header {
  margin-bottom: 18px;
}

.pa-rm-title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pa-rm-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--pa-rm-primary);
}

.pa-rm-period {
  display: inline-block;
  background: #fff4e5;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 800;
}

.pa-rm-intro {
  margin: 0;
  font-size: 15.5px;
  color: #475569;
  line-height: 1.55;
}

.pa-rm-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pa-rm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pa-rm-tab {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pa-rm-tab:hover {
  border-color: var(--pa-rm-primary);
  color: var(--pa-rm-primary);
}

.pa-rm-tab.is-active {
  background: var(--pa-rm-primary);
  border-color: var(--pa-rm-primary);
  color: #ffffff;
}

.pa-rm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 280px;
  justify-content: flex-end;
}

.pa-rm-year-select,
.pa-rm-search {
  padding: 8px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  color: #1e293b;
  background: #ffffff;
}

.pa-rm-search {
  flex: 1 1 200px;
  max-width: 300px;
}

.pa-rm-search:focus,
.pa-rm-year-select:focus {
  outline: none;
  border-color: var(--pa-rm-primary);
  box-shadow: 0 0 0 3px rgba(5, 110, 79, 0.12);
}

.pa-rm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.pa-rm-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid var(--pa-rm-primary);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pa-rm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(5, 110, 79, 0.1);
}

.pa-rm-photo-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e7f4f0 0%, #d1fae5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pa-rm-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.pa-rm-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pa-rm-primary), #034d37);
  color: #ffee00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 6px 16px rgba(5, 110, 79, 0.25);
  border: 3px solid #ffffff;
}

.pa-rm-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--pa-rm-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.pa-rm-badge.badge-agen-perubahan {
  background: var(--pa-rm-accent);
  color: #111a16;
}

.pa-rm-badge.badge-duta-pelayanan {
  background: #0b6bcb;
  color: #ffffff;
}

.pa-rm-year-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.pa-rm-body {
  padding: 15px 15px 10px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.pa-rm-name {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}

.pa-rm-pos {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pa-rm-primary);
}

.pa-rm-motto {
  margin: auto 0 0;
  padding: 8px 10px;
  background: #f8fbfa;
  border-left: 3px solid var(--pa-rm-accent);
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  font-style: italic;
  color: #475569;
  line-height: 1.45;
}

.pa-rm-card-foot {
  padding: 10px 15px 14px;
  border-top: 1px solid #f1f5f9;
}

.pa-rm-detail-btn {
  width: 100%;
  background: #e7f4f0;
  color: var(--pa-rm-primary);
  border: 1px solid #cce7de;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pa-rm-detail-btn:hover {
  background: var(--pa-rm-primary);
  border-color: var(--pa-rm-primary);
  color: #ffffff;
}

.pa-rm-empty {
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  font-size: 14px;
  margin-top: 10px;
}

.pa-rm-footer {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

.pa-rm-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pa-rm-accent);
  color: #111a16 !important;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 3px 10px rgba(255, 153, 0, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.pa-rm-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

/* Modal */
.pa-rm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 99999;
}

.pa-rm-modal-backdrop[hidden] {
  display: none !important;
}

.pa-rm-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  border-top: 5px solid #056e4f;
  padding: 24px 26px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  color: #1e293b;
}

.pa-rm-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pa-rm-modal-close:hover {
  background: #056e4f;
  color: #ffffff;
  border-color: #056e4f;
}

.pa-rm-modal-top {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.pa-rm-modal-media img {
  width: 96px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #056e4f;
}

.pa-rm-modal-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.pa-rm-modal-badges span {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e7f4f0;
  color: #056e4f;
}

.pa-rm-modal-meta h3 {
  margin: 0 0 4px;
  font-size: 19px;
  color: #0f172a;
}

.pa-rm-modal-pos {
  margin: 0 0 3px;
  font-weight: 700;
  color: #056e4f;
  font-size: 14px;
}

.pa-rm-modal-nip,
.pa-rm-modal-sk {
  margin: 0 0 2px;
  font-size: 13px;
  color: #475569;
}

.pa-rm-modal-motto {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #fffbeb;
  border-left: 4px solid #ff9900;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #334155;
}

.pa-rm-modal-desc h4 {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: #056e4f;
}

.pa-rm-modal-desc p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #334155;
}

.pa-rm-modal-pdf-area {
  margin-top: 16px;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.pa-rm-modal-pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13.5px;
}

.pa-rm-sk-open {
  color: #056e4f;
  font-weight: 700;
  text-decoration: none;
}

.pa-rm-modal-pdf-area iframe {
  width: 100%;
  height: 380px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

/* High Contrast WCAG */
body.pa-high-contrast .pa-rm-wrap,
body.pa-high-contrast .pa-rm-card,
body.pa-high-contrast .pa-rm-modal-dialog {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #ffff00 !important;
}
body.pa-high-contrast .pa-rm-title,
body.pa-high-contrast .pa-rm-name,
body.pa-high-contrast .pa-rm-pos,
body.pa-high-contrast .pa-rm-intro {
  color: #ffff00 !important;
}
body.pa-high-contrast .pa-rm-motto,
body.pa-high-contrast .pa-rm-detail-btn {
  background: #111111 !important;
  color: #ffffff !important;
  border-color: #ffff00 !important;
}
body.pa-high-contrast .pa-rm-cta {
  background: #ffff00 !important;
  color: #000000 !important;
}

@media (max-width: 1024px) {
  .pa-rm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .pa-rm-wrap { padding: 18px 16px; }
  .pa-rm-grid { grid-template-columns: 1fr; }
  .pa-rm-footer { justify-content: stretch; }
  .pa-rm-cta { width: 100%; }
  .pa-rm-modal-top { flex-direction: column; align-items: flex-start; }
}
