/* ============================================================
   SAYBERG · COMPETENCIAS POR ETAPAS v15.4.1
   ============================================================ */
.stage-page-head{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin:12px 0 24px}.stage-page-head h1{margin:6px 0 8px;font-size:clamp(2rem,4vw,3.2rem);color:#0a2135}.stage-head-actions{display:flex;gap:10px}.stage-section-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:16px}.stage-preview-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.stage-section-head h2{margin:4px 0}.stage-list{display:grid;gap:12px}.stage-list-card{display:flex;justify-content:space-between;align-items:center;gap:18px;border:1px solid #dce6ef;border-radius:18px;padding:18px;background:#fff}.stage-kicker{font-size:.72rem;font-weight:900;text-transform:uppercase;letter-spacing:.07em;color:#557086}.stage-list-card h3{margin:6px 0}.stage-list-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.stage-empty{border:1px dashed #bfd0df;border-radius:15px;padding:22px;text-align:center;color:#64798b;background:#fbfdff}.stage-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.stage-publish-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,1fr);gap:12px;align-items:stretch;margin-top:14px}.stage-public-link{border:1px dashed #cbd9e4;background:#f8fbfd;border-radius:14px;padding:12px}.stage-public-link a{font-weight:900;color:#0c63d6}.stage-builder{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:18px}.stage-builder-col{border:1px solid #dfe8f0;border-radius:17px;overflow:hidden;background:#fff}.stage-col-head{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:14px;border-bottom:1px solid #e8eef3;background:#f8fbfd}.stage-col-head strong,.stage-col-head small{display:block}.stage-col-head small{color:#73879a;margin-top:2px;font-size:.72rem}.stage-search,.stage-select{border:1px solid #cdd9e3;background:#fff;border-radius:11px;padding:10px 12px;outline:none;min-width:220px}.available-events{max-height:420px;overflow:auto;padding:8px}.available-event{display:flex;gap:10px;align-items:flex-start;padding:11px 12px;border:1px solid transparent;border-radius:12px;cursor:pointer}.available-event:hover{background:#f5f9fc;border-color:#e4edf3}.available-event.is-selected{background:#eef8e5;border-color:#d3ebbd}.available-event input{margin-top:3px}.available-event span{display:grid;gap:3px}.available-event small{color:#72869a;font-size:.7rem}.available-event .event-code{color:#0c63d6;font-weight:800}.selected-stages{padding:10px;display:grid;gap:8px;min-height:100px}.selected-stage-card{display:grid;grid-template-columns:34px minmax(0,1fr) 32px 32px 32px;gap:7px;align-items:center;border:1px solid #dfe8f0;border-radius:13px;padding:8px;background:#fff}.stage-order{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#0a2135;color:#a6ff3d;font-weight:900}.selected-stage-main{min-width:0}.selected-stage-main strong,.selected-stage-main small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selected-stage-main small{color:#71859a;font-size:.7rem;margin-top:2px}.icon-btn{border:1px solid #cfdae3;background:#fff;border-radius:9px;width:30px;height:30px;cursor:pointer;font-weight:900}.icon-btn:hover:not(:disabled){background:#eef5f9}.icon-btn:disabled{opacity:.35;cursor:not-allowed}.icon-btn.danger{color:#c23b32}.stage-counter{font-weight:900;background:#edf5ff;border-radius:999px;padding:5px 10px;color:#0c63d6}.stage-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px;padding-top:16px;border-top:1px solid #e8eef3}.stage-status-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;font-size:.67rem;font-weight:900;text-transform:uppercase}.stage-status-badge.draft{background:#fff4db;color:#9a6500}.stage-status-badge.published{background:#e7f7df;color:#28730f}.stage-status-badge.archived{background:#eef2f5;color:#687b8b}.stage-stats{display:flex;gap:8px;flex-wrap:wrap}.stage-stats span{background:#f3f7fa;border:1px solid #dfe8ef;border-radius:999px;padding:7px 10px;font-size:.72rem}.stage-source-chips{display:flex;gap:10px;overflow:auto;padding:2px 0 14px}.source-chip{min-width:180px;display:grid;gap:3px;padding:11px 12px;border:1px solid #dce7ef;border-radius:13px;background:#fbfdff}.source-chip strong{font-size:.7rem;color:#0c63d6;text-transform:uppercase}.source-chip span{font-weight:900;font-size:.82rem}.source-chip small{color:#71859a;font-size:.68rem}.source-chip.missing{border-color:#f1c6c2;background:#fff8f7}.source-chip.missing strong{color:#b33a31}.stage-filterbar{display:flex;gap:10px;justify-content:flex-end;align-items:center;margin:6px 0 12px}.stage-filterbar .stage-search{min-width:320px}.stage-results-wrap{max-height:650px}.stage-results-table{min-width:1100px}.stage-results-table td small,.stage-results-table th small{display:block;color:#73869a;font-size:.66rem;margin-top:3px}.stage-cell{display:grid;gap:3px}.stage-cell small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}.stage-cell-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.mini-btn{border:1px solid #ccd9e2;background:#fff;border-radius:8px;padding:4px 7px;font-size:.66rem;font-weight:900;cursor:pointer;color:#23445d}.mini-btn:hover{background:#f3f8fb}.match-badge{display:inline-block;width:max-content;border-radius:999px;padding:2px 6px;font-size:.58rem;font-weight:900}.match-badge.review{background:#fff1da;color:#936100}.match-badge.auto{background:#e9f8e1;color:#2b7413}.match-badge.manual{background:#e7f2ff;color:#1665a5}.status-pill{display:inline-flex;border-radius:999px;padding:5px 8px;font-weight:900;font-size:.65rem;background:#edf3f7}.stage-empty-cell{color:#9aaaba;text-align:center!important}.stage-modal{display:none;position:fixed;inset:0;background:rgba(3,16,29,.58);z-index:2000;align-items:center;justify-content:center;padding:18px}.stage-modal.is-open{display:flex}.stage-modal-card{position:relative;width:min(680px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:22px;padding:24px;box-shadow:0 25px 70px rgba(0,0,0,.25)}.stage-modal-close{position:absolute;right:16px;top:12px;border:0;background:transparent;font-size:30px;cursor:pointer;color:#607487}.stage-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.stage-modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}.public-stage-page .nav{border-bottom:1px solid rgba(6,20,38,.07)}.stage-public-hero{background:linear-gradient(120deg,#061426,#0b2a48);color:#fff;padding:95px 0 75px}.stage-public-hero h1{font-size:clamp(2.4rem,5vw,4.8rem);margin:10px 0 12px;max-width:900px}.stage-public-hero p{color:#b9cbdc;max-width:780px}.stage-hero-meta{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.stage-hero-meta span{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.07);padding:7px 10px;border-radius:999px;font-size:.72rem;font-weight:900}.stage-public-tabs{display:flex;gap:8px;overflow:auto;padding-bottom:12px}.stage-tab{border:1px solid #d7e1e9;background:#fff;border-radius:999px;padding:10px 14px;font-weight:900;cursor:pointer;white-space:nowrap}.stage-tab.active{background:#0a2135;color:#a6ff3d;border-color:#0a2135}.stage-public-summary{display:flex;gap:10px;flex-wrap:wrap;margin:6px 0 16px}.public-summary-card{min-width:140px;border:1px solid #dce7ef;border-radius:15px;background:#fff;padding:13px}.public-summary-card strong{display:block;font-size:1.35rem}.public-summary-card span{color:#718397;font-size:.72rem;font-weight:800}.stage-status-badge.published{background:#e7f7df;color:#28730f}.stage-admin-page .panel-card{scroll-margin-top:90px}.stage-admin-page .login-card h1{margin-bottom:10px}.modal-open{overflow:hidden}@media(max-width:900px){.stage-preview-head-actions{width:100%;justify-content:flex-start}.stage-builder,.stage-publish-row{grid-template-columns:1fr}.stage-form-grid{grid-template-columns:1fr}.stage-list-card{align-items:flex-start;flex-direction:column}.stage-list-actions{justify-content:flex-start}.stage-filterbar{justify-content:stretch;flex-direction:column;align-items:stretch}.stage-filterbar .stage-search{min-width:0}.stage-edit-grid{grid-template-columns:1fr}}@media(max-width:700px){.stage-page-head{display:block}.stage-head-actions{margin-top:14px}.stage-search{min-width:0;width:100%}.stage-col-head{display:block}.stage-col-head .stage-search{margin-top:10px}.stage-modal{padding:10px}.stage-modal-card{padding:20px 16px}.public-stage-page .navlinks{display:none}}

.stage-catalog-card{display:grid;gap:5px;border:1px solid #dce7ef;border-radius:16px;background:#fff;padding:16px;text-decoration:none;color:#0a2135;margin-bottom:10px}.stage-catalog-card strong{font-size:1rem}.stage-catalog-card small{color:#718397}

.category-leader-note{display:inline-block;margin-left:22px;padding-left:2px;color:#64748b;font-size:12px;font-weight:600;vertical-align:middle}.category-leader-note{display:inline-block;margin-left:22px;padding-left:2px;color:#64748b;font-size:12px;font-weight:600;vertical-align:middle}
@media (max-width:700px){.category-leader-note{display:inline-block;margin-left:12px;padding-left:0}}

/* v15.4.7 · edición explícita de competencias guardadas */
.stage-list-help{margin:6px 0 0;max-width:760px;font-size:.92rem;line-height:1.45}
.stage-list-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.stage-list-actions .stage-open{font-weight:800}

/* v15.4.8 · botón Editar etapas visible sobre tarjetas blancas */
.stage-admin-page .stage-list-actions .stage-open{background:#fff !important;color:#0b2039 !important;border:2px solid #0b2039 !important}
.stage-admin-page .stage-list-actions .stage-open:hover{background:#eaf1f6 !important;color:#061426 !important;border-color:#061426 !important}


/* v15.4.9 · Botón Editar etapas reforzado: texto siempre visible y alto contraste. */
.stage-admin-page .stage-list-actions .stage-edit-button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  min-width:160px !important;
  min-height:42px !important;
  padding:10px 16px !important;
  border:2px solid #0b2039 !important;
  border-radius:999px !important;
  background:#ffffff !important;
  color:#0b2039 !important;
  -webkit-text-fill-color:#0b2039 !important;
  font-family:inherit !important;
  font-size:.8rem !important;
  font-weight:950 !important;
  line-height:1.15 !important;
  white-space:nowrap !important;
  text-indent:0 !important;
  opacity:1 !important;
  visibility:visible !important;
  overflow:visible !important;
  box-shadow:0 4px 12px rgba(11,32,57,.10) !important;
}
.stage-admin-page .stage-list-actions .stage-edit-button .stage-edit-icon,
.stage-admin-page .stage-list-actions .stage-edit-button .stage-edit-label{
  display:inline-block !important;
  color:#0b2039 !important;
  -webkit-text-fill-color:#0b2039 !important;
  visibility:visible !important;
  opacity:1 !important;
}
.stage-admin-page .stage-list-actions .stage-edit-button:hover{
  background:#eaf1f6 !important;
  border-color:#061426 !important;
  color:#061426 !important;
  -webkit-text-fill-color:#061426 !important;
  transform:translateY(-2px);
}
@media(max-width:900px){
  .stage-admin-page .stage-list-actions .stage-edit-button{min-width:170px !important;}
}
