/* Base modal container - using z-index system */
.rcp-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: var(--riva-z-modal, 20200); /* Fallback to 20200 */
  pointer-events: none; /* Prevent blocking when closed */
}

/* Açık modal */
.rcp-modal.is-open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /* Enable clicks when open */
}

/* Backdrop - using z-index system */
.rcp-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  z-index: var(--riva-z-modal-backdrop, 20100); /* Fallback to 20100 */
  pointer-events: none; /* Prevent blocking when closed */
}

.rcp-modal-backdrop.is-open { 
  display: block;
  pointer-events: auto; /* Block clicks to content below when open */
}

/* Dialog kutusu */
.rcp-modal__dialog {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.98);
  background: var(--rcp-surface, #0b1324);
  color: #fff;
  width: min(680px, 96vw);
  max-height: 86vh;
  overflow: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  z-index: var(--riva-z-modal-dialog, 20300); /* Fallback to 20300 */
}

.rcp-modal.is-open .rcp-modal__dialog {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Modal content */
.rcp-modal__content {
  padding: 32px;
  background: rgba(20,20,30,0.98);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Modal header */
.rcp-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.rcp-modal__header h3 {
  margin: 0;
  font-size: 24px;
  color: #fff;
}

.rcp-modal__close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  position: relative;
  z-index: var(--riva-z-modal-close, 20400); /* Fallback to 20400 */
}

.rcp-modal__close:hover {
  color: #fff;
}

/* Modal body */
.rcp-modal__body {
  margin-bottom: 24px;
}

/* Modal footer */
.rcp-modal__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Body scroll lock */
body.rcp-modal-open {
  overflow: hidden;
}

/* Detail modal styling - fix layout and text overflow */
.rcp-modal__body {
  max-width: 920px;
  width: 95%;
}

/* Request detail fields table */
#request-detail-fields {
  width: 100%;
  margin-top: 16px;
}

#request-detail-fields th {
  text-align: left;
  width: 200px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

#request-detail-fields td {
  padding: 12px;
  word-break: break-word;
  color: #fff;
}

#request-detail-fields tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#request-detail-fields tr:last-child {
  border-bottom: none;
}

/* Request detail content */
#request-detail-content {
  padding: 0;
}

.rcp-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin-bottom: 24px;
}

.rcp-detail dt {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.rcp-detail dd {
  color: #fff;
  margin: 0;
}