/* Overlay y Contenedor */
.rm-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5); z-index: 9999;
}

.rm-container {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; width: 1150px; max-width: 95vw; height: 95vh;
  border-radius: var(--radius-lg); display: flex; flex-direction: column;
  z-index: 10000; box-shadow: var(--shadow-elevated);
  font-family: var(--font-family);
  overflow: hidden;
}

/* Header */
.rm-header-wrapper {
  background: #fff; border-bottom: 1px solid var(--bordes);
  flex-shrink: 0;
}

.rm-header-top {
  padding: 24px 24px 10px 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
}

.rm-title { font-size: 1.5rem; font-weight: 800; color: var(--azul-gazapo); margin: 0; }
.rm-subtitle { font-size: var(--font-size-body); color: var(--texto-secundario); margin: 4px 0 0 0; }

.rm-meta-row { display: flex; align-items: center; gap: 15px; margin-top: 8px; }
.rm-badges-group { display: flex; gap: 8px; }

.rm-badge { font-size: var(--font-size-label); font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.badge-yellow { background: var(--warning-bg); color: var(--warning); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red { background: var(--error-bg); color: var(--error); }

.rm-close-btn { background: none; border: none; cursor: pointer; color: var(--texto-secundario); }
.rm-close-btn:hover { color: var(--texto-primario); }

/* Tabs */
.rm-tabs-container {
  padding: 0 24px; display: flex; gap: 4px; overflow-x: auto;
}

.rm-tab {
  padding: 12px 16px; font-size: var(--font-size-body); font-weight: 600;
  border-bottom: 2px solid transparent; text-decoration: none;
  color: var(--texto-secundario); display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}

.rm-tab:hover { color: var(--azul-gazapo); border-color: var(--bordes); }
.rm-tab.active {
  border-color: var(--azul-gazapo); color: var(--azul-gazapo); background: var(--blanco-ui);
}

.rm-status-dot { font-size: var(--font-size-label); padding: 2px 6px; border-radius: var(--radius-md); }
.dot-green { background: var(--success-bg); color: var(--success); }
.dot-red { background: var(--error-bg); color: var(--error); }
.dot-yellow { background: var(--warning-bg); color: var(--warning); }

.rm-tab-conf { font-size: var(--font-size-label); font-weight: 800; }

/* Body y Scroll */
.rm-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 24px; }

/* Confidence Banner */
.rm-confidence-banner { border: 2px solid; border-radius: var(--radius-md); padding: 16px; }
.banner-green { background: var(--success-bg); border-color: var(--success); }
.banner-yellow { background: var(--warning-bg); border-color: var(--warning); }
.banner-red { background: var(--error-bg); border-color: var(--error); }

.rm-banner-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.rm-banner-left { display: flex; align-items: center; gap: 8px; }
.rm-conf-title { font-size: 1.125rem; font-weight: 700; }

.rm-conf-pill { font-size: var(--font-size-label); font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.pill-green { background: var(--success-bg); color: var(--success); }
.pill-yellow { background: var(--warning-bg); color: var(--warning); }
.pill-red { background: var(--error-bg); color: var(--error); }

.rm-progress-bg { width: 100%; height: 12px; background: var(--bordes); border-radius: var(--radius-sm); overflow: hidden; }
.rm-progress-fill { height: 100%; border-radius: var(--radius-sm); }
.bg-green { background: var(--success); }
.bg-yellow { background: var(--warning); }
.bg-red { background: var(--error); }

/* Utility Colors */
.text-green { color: var(--success); }
.text-yellow { color: var(--warning); }
.text-red { color: var(--error); }
.text-purple { color: #9333ea; }
.text-blue { color: var(--info); }
.text-blue-dark { color: var(--azul-oscuro); }
.text-primary { color: var(--azul-gazapo); }
.text-gray { color: var(--gris-claro); }

/* Grid Layout */
.rm-grid {
  display: flex;
  gap: 24px;
}
.rm-column-left, .rm-column-right {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}
.rm-column-left .rm-card,
.rm-column-right .rm-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media(max-width: 1024px) { .rm-grid { grid-template-columns: 1fr; } }

/* Cards */
.rm-card { border: 1px solid var(--bordes); border-radius: var(--radius-md); padding: 16px; }
.rm-card-title { font-size: 1rem; font-weight: 700; color: var(--azul-gazapo); margin: 0 0 12px 0; display: flex; align-items: center; gap: 8px; }

/* Preview Box */
.rm-preview-box {
  background: var(--blanco-ui); border: 2px dashed var(--bordes); border-radius: var(--radius-md);
  aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 16px; padding: 20px; text-align: center;
}
.rm-preview-type { font-size: 1.125rem; font-weight: 600; color: var(--texto-primario); margin: 10px 0 0; }
.rm-preview-user { font-size: var(--font-size-body); color: var(--gris-claro); margin: 5px 0 15px; }
.rm-link-btn { background: none; border: none; color: var(--azul-gazapo); font-weight: 600; font-size: var(--font-size-body); cursor: pointer; }
.rm-link-btn:hover { color: var(--coral); }

.rm-nav-buttons { display: flex; justify-content: space-between; }
.rm-nav-btn { background: none; border: none; font-weight: 600; color: var(--azul-gazapo); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.rm-nav-btn:disabled { color: var(--gris-claro); cursor: not-allowed; }

/* Data List */
.rm-data-list { display: flex; flex-direction: column; gap: 12px; }
.rm-data-row { padding: 12px; border-radius: var(--radius-sm); }
.rm-data-row label { display: block; font-size: var(--font-size-label); font-weight: 700; margin-bottom: 4px; }
.rm-data-row p { font-size: var(--font-size-body); font-weight: 600; margin: 0; color: var(--texto-primario); }

.purple-bg { background: #faf5ff; border: 1px solid #f3e8ff; }
.gray-bg { background: var(--blanco-ui); }
.blue-bg { background: var(--info-bg); border: 1px solid var(--bordes); }
.red-bg { background: var(--error-bg); border: 1px solid var(--error-bg); }
.green-bg { background: var(--success-bg); border: 1px solid var(--success-bg); }

.rm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rm-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.rm-grid-3 label { font-size: var(--font-size-label); font-weight: 700; color: var(--gris-claro); }
.rm-grid-3 p { font-size: var(--font-size-body); font-weight: 600; color: var(--texto-primario); margin: 0; }

/* Checklist */
.rm-checklist { display: flex; flex-direction: column; gap: 8px; }
.rm-check-item { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-body); color: var(--texto-primario); padding: 8px; border-radius: 4px; cursor: pointer; }
.rm-check-item:hover { background: #fff; }

/* Reject Form */
.rm-reject-box { background: var(--error-bg); border: 2px solid var(--error); border-radius: var(--radius-md); padding: 16px; }
.rm-reject-box textarea { width: 100%; border: 1px solid var(--error); border-radius: var(--radius-sm); padding: 8px; margin-top: 8px; font-family: inherit; }
.rm-reject-box textarea:focus { outline: none; border-color: var(--error); }

/* Footer */
.rm-footer {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--bordes);
  display: flex; justify-content: space-between; align-items: center;
}
.rm-footer-left { display: flex; align-items: center; gap: 12px; }
.rm-pending-text { font-size: var(--font-size-body); color: var(--texto-secundario); }
.flex-row { display: flex; gap: 12px; }

/* Buttons */
.btn-gray { background: var(--bordes); color: var(--texto-primario); padding: 12px 24px; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; border: none; cursor: pointer; }
.btn-gray:hover { background: var(--gris-claro); }

.btn-green { background: var(--success); color: white; padding: 12px 32px; border-radius: var(--radius-sm); font-size: 1rem; font-weight: 600; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn-green:hover { background: #259a48; }

.btn-red-outline { background: white; border: 1px solid var(--error); color: var(--error); padding: 11px 24px; font-size: 1rem; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn-red-outline:hover { background: var(--error-bg); }

.btn-red-solid { background: var(--error); color: white; padding: 12px 32px; border-radius: var(--radius-sm); font-weight: 600; border: none; cursor: pointer; }
.btn-red-solid:disabled { background: var(--gris-claro); cursor: not-allowed; }

/* Icons size helpers */
.icon-sm { width: 20px; height: 20px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 96px; height: 96px; }
.font-mono { font-family: monospace; }

#review-modal, #review-modal * {
  font-family: var(--font-family) !important;
}

#review-modal i.fas, #review-modal i.fa, #review-modal i.far, #review-modal i.fab {
  font-family: 'Font Awesome 5 Free' !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
