/* Modulo beneficios */

/* --- beneficios.css --- */
/* Estilos locales del módulo beneficios (admin + wizard).
   Look del formulario público: css/shared/public_form.css */

.rb-public-page .page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rb-public-page .header.header-pro {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.rb-modulo-panel {
  max-width: 48rem;
  margin: 0 auto;
}

.rb-estado-bd {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.rb-estado-bd--ok {
  background: #e8f5e9;
  color: #1b5e20;
}

.rb-estado-bd--error {
  background: #ffebee;
  color: #b71c1c;
}

.rb-modulo-panel pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
}

.rb-nota-ayuda {
  color: var(--text-muted, #4b5563);
  font-size: 0.9rem;
}

/* ── Wizard paso a paso ── */
.rb-public-page .wizard-step {
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.35s ease, transform 0.35s ease;
  position: relative;
}

.rb-public-page .wizard-step-active {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
}

.rb-public-page .wizard-step-locked {
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.rb-public-page .wizard-step-done {
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
}

.rb-public-page .wizard-step-done .step-header,
.rb-public-page .wizard-step-done .step-tip {
  display: none;
}

.rb-public-page #ebbBtnEnviar.ent-btn-save--ready {
  box-shadow: 0 0 0 2px rgba(212, 19, 22, 0.25);
}

.rb-public-page .ent-foto-video,
.rb-public-page .ent-foto-canvas {
  width: 100%;
  max-height: min(52vh, 360px);
  box-sizing: border-box;
  border: 2px solid #ef4444;
  border-radius: 12px;
  background: #111827;
  object-fit: cover;
  display: block;
}

.rb-public-page .ent-foto-canvas {
  display: none;
  height: auto;
}

.rb-public-page .ent-foto-inline {
  margin-top: 14px;
  position: relative;
}

.rb-public-page .ent-foto-status {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #4b5563;
}

/* --- entregas.css --- */
/* Crear entrega de beneficios - estilos del módulo */
:root {
  --crev-white: #ffffff;
  --crev-primary: #111111;
  --crev-border: #e5e7eb;
  --crev-border-focus: #374151;
  --crev-muted: #6b7280;
  --crev-accent: #d41316;
  --crev-btn-blue: #d41316;
  --crev-btn-blue-dark: #b01013;
  --crev-btn-gray: #6a747e;
  --crev-btn-gray-dark: #5a636c;
  --crev-red-pure: #d41316;
  --crev-shadow-07: #00000012;
  --crev-shadow-06: #0000000f;
  --crev-shadow-blue-25: #d4131640;
  --crev-shadow-gray-25: #6a747e40;
  --crev-border-soft: #00000014;
  --crev-border-soft-10: #0000001a;
  --crev-focus-ring: #3741511f;
  --crev-row-hover: #00000005;
  --crev-overlay: #00000073;
  --crev-msg-ok-bg: #16a34a14;
  --crev-msg-ok-bd: #16a34a47;
  --crev-msg-err-bg: #c2410c1a;
  --crev-msg-err-bd: #c2410c59;
  --crev-radius-sm: 8px;
  --crev-radius-md: 12px;
  --crev-fs-sm: 12px;
  --crev-fs-md: 14px;
  --crev-fs-base: 13px;
  --crev-fs-lg: 15px;
  --crev-fs-title: 22px;
  --crev-input-min-h: 34px;
}

/* Layout admin (mismo patrón que Formaciones / Dotación) */
body.beneficios-app.module-app-ui {
  background: var(--dot-surface, #f5f5f5);
  background-image: none;
}

body.beneficios-app.module-app-ui .admin-layout#adminLayout {
  max-width: none;
  width: auto;
  min-height: 0;
  display: block;
  align-items: stretch;
  padding: 24px 20px;
  margin: 0;
}

body.beneficios-app.module-app-ui #sec_home.section {
  background: transparent;
  border: 0;
  box-shadow: none;
  max-width: none !important;
  padding: 0 !important;
}

body.beneficios-app .crev-module {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.crev-msg__pre {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
  font-family: inherit;
}

.crev-module input:not([type="hidden"]),
.crev-modal input:not([type="hidden"]) {
  min-height: var(--crev-input-min-h);
  box-sizing: border-box;
}

.crev-modal select {
  min-height: var(--crev-input-min-h);
  box-sizing: border-box;
}

body.beneficios-app .bep-busqueda-cedula {
  margin: 0 0 14px;
}

body.beneficios-app .edd-list-card {
  margin-bottom: 0;
}

body.beneficios-app .edd-list-empty {
  text-align: center;
  color: #64748b;
  padding: 28px 12px;
}

/* En móvil: mantener tabla real (scroll horizontal), no cards apiladas */
@media (max-width: 720px) {
  body.beneficios-app .edd-list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.beneficios-app .edd-list-table {
    display: table;
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
  }

  body.beneficios-app .edd-list-table thead {
    display: table-header-group;
  }

  body.beneficios-app .edd-list-table tbody {
    display: table-row-group;
  }

  body.beneficios-app .edd-list-table tr {
    display: table-row;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  body.beneficios-app .edd-list-table th,
  body.beneficios-app .edd-list-table td {
    display: table-cell;
    justify-content: initial;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    padding: 10px 12px;
  }

  body.beneficios-app .edd-list-table td::before {
    content: none;
    display: none;
  }

  body.beneficios-app .edd-list-empty {
    display: table-cell !important;
    text-align: center;
    border-bottom: 1px solid #e8e8e8;
    margin: 0;
  }
}

body.beneficios-app .ins-formacion-resumen {
  margin: 0 0 14px;
  padding: 18px;
  border-radius: 12px;
  background: #fff;
  color: var(--color-text, #333);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

body.beneficios-app .ins-formacion-resumen__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

body.beneficios-app .ins-formacion-resumen__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

body.beneficios-app .ins-formacion-dl {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 8px 16px;
  font-size: 13px;
  align-items: center;
  margin: 0;
}

body.beneficios-app .ins-formacion-dl dt {
  margin: 0;
  color: #666;
  font-weight: 500;
}

body.beneficios-app .ins-formacion-dl dd {
  margin: 0;
  color: #333;
  word-break: break-word;
}

@media (max-width: 720px) {
  body.beneficios-app .ins-formacion-dl {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
    gap: 8px 10px;
    font-size: 12px;
  }
}

body.beneficios-app .rf-pagination {
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
  background: #fafafa;
}

body.beneficios-app .rf-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 12px;
  color: #374151;
}

body.beneficios-app .rf-page-size__select {
  min-height: 34px;
  min-width: 72px;
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

body.beneficios-app .rf-page-info {
  font-size: 12px;
  color: #374151;
}

body.beneficios-app .rf-page-btn {
  min-height: 34px;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  box-sizing: border-box;
}

body.beneficios-app .rf-page-btn--icon {
  padding: 0;
  width: 34px;
}

body.beneficios-app .rf-page-btn:hover:not(.is-disabled) {
  border-color: #e8c1c4;
  background: var(--dot-brand-light, #f4d3d5);
  color: var(--dot-brand, #d41316);
}

body.beneficios-app .rf-page-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (max-width: 720px) {
  body.beneficios-app.module-app-ui {
    padding-bottom: calc(40px + 72px);
  }

  body.beneficios-app .edd-list-card {
    overflow: visible;
  }

  body.beneficios-app .rf-pagination {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 40px;
    z-index: 90;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  body.beneficios-app.module-app-ui {
    padding-bottom: calc(44px + 80px);
  }

  body.beneficios-app .rf-pagination {
    bottom: 44px;
  }
}

.crev-btn-primary {
  background: var(--dot-brand, #d41316);
  color: var(--crev-white);
  border: 1px solid var(--dot-brand-border, #b01013);
  min-height: 34px;
  min-width: 100px;
  padding: 8px 16px;
  border-radius: var(--crev-radius-sm);
  cursor: pointer;
  font-size: var(--crev-fs-sm);
  font-weight: 600;
  box-shadow: none;
  font-family: "Roboto", sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crev-btn-primary:hover {
  background: var(--dot-brand-hover, #b01013);
  border-color: #8f0e10;
}

.crev-title {
  margin: 0;
  font-size: var(--app-page-title-size, var(--crev-fs-title));
  font-weight: var(--app-page-title-weight);
  line-height: var(--app-page-title-line);
  color: var(--app-page-title-color);
  text-align: left;
}

.crev-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  min-height: 34px;
  min-width: 100px;
  padding: 8px 16px;
  border-radius: var(--crev-radius-sm);
  cursor: pointer;
  font-size: var(--crev-fs-sm);
  font-weight: 600;
  box-shadow: none;
  font-family: "Roboto", sans-serif;
}

.crev-btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.crev-msg {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--crev-radius-sm);
  border: 1px solid var(--crev-border-soft);
  background: var(--crev-white);
  color: var(--crev-primary);
  font-size: var(--crev-fs-base);
}

.crev-toast {
  position: fixed;
  top: 92px;
  right: 20px;
  z-index: 10050;
  width: min(520px, calc(100vw - 32px));
  margin: 0;
  box-shadow: 0px 10px 24px #0000002e;
  border-width: 1px;
  animation: crev-toast-in 0.22s ease-out;
}

.crev-toast.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

@keyframes crev-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

.crev-msg--ok {
  background: var(--crev-msg-ok-bg);
  border-color: var(--crev-msg-ok-bd);
  color: #0f5132;
}

.crev-msg--err {
  background: var(--crev-msg-err-bg);
  border-color: var(--crev-msg-err-bd);
  color: #9a3412;
}

@media (max-width: 768px) {
  .crev-toast {
    top: 78px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}

.crev-module .inf-table th:last-child,
.crev-module .inf-table td:last-child {
  text-align: center;
}

.crev-accion-form {
  display: inline-flex;
  margin: 0;
}

.crev-pagination {
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid #eee;
  background: #fafafa;
}

.crev-page-info {
  font-size: 12px;
  color: #374151;
}

.crev-page-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

.crev-page-btn:hover {
  border-color: var(--dot-brand, #d41316);
  background: #fff5f5;
  color: var(--dot-brand, #d41316);
}

.crev-page-btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Modal programacion (mismo shell que Formaciones .for-modal-*) */
body.beneficios-app .modal.hidden {
  display: none !important;
}

body.beneficios-app .modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 10040;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

body.beneficios-app .modal.open {
  display: flex;
}

body.beneficios-app .modal .for-modal-card {
  background: #fff;
  border-radius: 12px;
  max-width: min(560px, 100%);
  width: 100%;
  max-height: min(92dvh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family-app, Roboto, sans-serif);
}

body.beneficios-app .modal .for-modal-card > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

body.beneficios-app .modal .for-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
  flex-shrink: 0;
}

body.beneficios-app .modal .for-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
}

body.beneficios-app .modal .for-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
}

body.beneficios-app .modal .for-modal-close:hover,
body.beneficios-app .modal .for-modal-close:focus-visible {
  background: #f5f5f5;
  color: var(--dot-brand, #d41316);
  outline: none;
}

body.beneficios-app .modal .for-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  background: #fff;
}

body.beneficios-app .modal .for-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
  flex-shrink: 0;
}

body.beneficios-app #bepModal .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 12px;
  margin: 0;
}

body.beneficios-app #bepModal .form-grid .full {
  grid-column: 1 / -1;
}

body.beneficios-app #bepModal .form-grid label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  line-height: 1.3;
}

body.beneficios-app #bepModal .form-grid input,
body.beneficios-app #bepModal .form-grid select {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

body.beneficios-app #bepModal .form-grid input:focus,
body.beneficios-app #bepModal .form-grid select:focus {
  outline: none;
  border-color: var(--dot-brand, #d41316);
  box-shadow: 0 0 0 3px rgba(212, 19, 22, 0.1);
}

body.beneficios-app #bepModal .label-req {
  color: #d41316;
  font-weight: 700;
}

@media (max-width: 560px) {
  body.beneficios-app #bepModal .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Modal foto inscritos */
.bep-foto-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.bep-foto-modal[hidden] {
  display: none !important;
}

.bep-foto-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.bep-foto-modal__panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.bep-foto-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
}

.bep-foto-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.bep-foto-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.bep-foto-modal__close:hover {
  background: #f1f5f9;
  color: #111827;
}

.bep-foto-modal__body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.bep-foto-modal__img {
  max-width: 100%;
  max-height: min(70vh, 520px);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.bep-sin-foto {
  color: #94a3b8;
  font-size: 13px;
}

/* Estados alineados con Formaciones */
.rf-estado-programada,
.rf-estado-en-proceso,
.rf-estado-finalizada {
  font-weight: 400;
  font-size: inherit;
  white-space: nowrap;
}

.rf-estado-programada { color: #ca8a04; }
.rf-estado-en-proceso { color: #2563eb; }
.rf-estado-finalizada { color: #15803d; }
