/* Ajustes compactos para 5 Porqués y listas de acciones correctivas. */
.five-why-dialog{width:min(1480px,99vw)}
.five-why-shell{height:min(94vh,900px);min-height:min(720px,94vh);max-height:96vh;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.five-why-board{overflow-x:hidden;overflow-y:auto;padding:.65rem;background:#f6f9f7}
.five-why-grid{width:100%;min-width:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.35rem}
.five-why-heading{padding-bottom:.35rem}
.five-why-heading>div{min-height:56px;padding:.4rem;gap:.3rem}
.five-why-heading strong{font-size:.58rem}
.five-why-heading button{padding:.32rem .38rem;font-size:.52rem}
.five-why-rows{min-height:440px;align-content:start;gap:.35rem}
.five-why-cell{min-height:72px;border:1px solid #111;border-radius:7px;background:#fff}
.five-why-row{position:relative;margin-top:.35rem}
.five-why-row.is-new .five-why-cell{animation:five-why-new-row 1.1s ease-out}
@keyframes five-why-new-row{0%{background:#dff5e9;box-shadow:0 0 0 3px #2c8b623d}100%{background:#fff;box-shadow:none}}
.five-why-cell.is-filled{padding:.5rem;display:flex;align-items:center;justify-content:space-between;gap:.45rem;border-width:2px;color:#111;font-weight:400}
.five-why-cell.is-filled.is-rightmost{background:#dceffc}
.five-why-row article{height:auto;min-height:58px;padding:.42rem;grid-template-columns:minmax(0,1fr) auto;gap:.3rem;border:2px solid #111;background:#fff;color:#111}
.five-why-cell-copy{min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.38rem}.five-why-cell-copy b{min-width:29px;padding:.18rem .25rem;border-radius:6px;background:#dff0e8;color:var(--green);font-size:.52rem;font-weight:900;text-align:center}.five-why-row article .five-why-cell-copy span{min-width:0;color:#111;font-size:clamp(.58rem,.8vw,.68rem);font-weight:400;line-height:1.4;overflow-wrap:anywhere}
.five-why-row article button{width:27px;height:27px;font-size:.88rem}
.five-why-cell-actions{flex:0 0 auto;margin-left:auto;display:flex!important;flex-direction:column;align-items:center;gap:.22rem;visibility:visible!important;opacity:1!important}.five-why-cell-actions button{width:28px!important;height:28px!important;display:grid!important;place-items:center;border-radius:50%;font-weight:950;cursor:pointer;visibility:visible!important;opacity:1!important}.five-why-cell-actions [data-edit-why-cell]{border-color:#9bbfd2!important;background:#eef7fc!important;color:#17668f!important;font-size:.72rem!important}.five-why-cell-actions [data-add-why-cell]{border-color:#83b39f!important;background:var(--green-soft)!important;color:var(--green)!important}.five-why-cell-actions [data-delete-why-cell]{border-color:#dfb5b5!important;background:#fff3f3!important;color:var(--red)!important;font-size:1rem!important}.danger-button{border-color:var(--red)!important;background:var(--red)!important;color:#fff!important}
.five-why-node-actions{display:flex;align-items:center;gap:.2rem}.five-why-row article .why-edit-button{border-color:#a9c8d9;background:#eef7fc;color:#17668f;font-size:.72rem}.five-why-row article .why-delete-button{border-color:#dfb5b5;background:#fff3f3;color:var(--red);font-size:1rem}.five-why-row article .why-delete-button.is-blocked{border-color:#d3d9d6;background:#f2f4f3;color:#8b9691}.five-why-row article .why-add-button{border-color:#83b39f;background:var(--green-soft);color:var(--green)}
.five-why-empty-cell{min-height:58px}
.five-why-empty{width:100%;min-width:0;min-height:155px}
.why-delete-dialog{width:min(520px,94vw)}.why-delete-alert{margin:.65rem 0;padding:.72rem;border:2px solid #d56a6a;border-radius:10px;background:#fff0f0;color:#8c2020;font-size:.68rem;font-weight:850;line-height:1.45}.why-delete-summary{margin:.65rem 0;padding:.7rem;border:1px solid #e3c1c1;border-radius:10px;background:#fff7f7}.why-delete-summary small,.why-delete-summary strong{display:block}.why-delete-summary small{color:var(--red);font-size:.55rem;font-weight:900;text-transform:uppercase}.why-delete-summary strong{margin-top:.2rem;font-size:.69rem;line-height:1.45;overflow-wrap:anywhere}.why-delete-dialog .confirmation-check{margin-top:.65rem}
.analysis-method-selector{margin:0 0 .75rem;padding:.7rem;border:1px solid var(--line);border-radius:11px;background:#f8fbf9}.analysis-method-selector legend{padding:0 .25rem;color:#294036;font-size:.64rem;font-weight:900}.analysis-method-selector>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}.analysis-method-selector label{position:relative}.analysis-method-selector input{position:absolute;opacity:0}.analysis-method-selector span{min-height:68px;padding:.65rem;display:flex;flex-direction:column;justify-content:center;border:1px solid #bfd1c8;border-radius:10px;background:#fff;cursor:pointer}.analysis-method-selector span strong,.analysis-method-selector span small{display:block}.analysis-method-selector span strong{font-size:.7rem}.analysis-method-selector span small{margin-top:.15rem;color:var(--muted);font-size:.55rem}.analysis-method-selector input:checked+span{border-color:var(--green);background:var(--green-soft);box-shadow:inset 0 0 0 1px var(--green)}.analysis-method-selector input:focus-visible+span{outline:3px solid #2f88682b}
.ishikawa-launchers>button{border-color:#b9cfe0;background:linear-gradient(135deg,#f4f9fd,#fff)}.ishikawa-launchers>button>span{background:#e5f1f8;color:#17668f}

.corrective-cause-list{margin-bottom:.75rem;padding:.65rem;border:1px solid var(--line);border-radius:11px;background:#f8fbf9}
.corrective-cause-list>header{margin-bottom:.48rem;display:flex;align-items:center;justify-content:space-between}
.corrective-cause-list>header strong{font-size:.72rem}
.corrective-cause-list>header small{color:var(--muted);font-size:.55rem}
.corrective-list-heading,.corrective-cause-row{display:grid;grid-template-columns:1.1fr 1.25fr 1fr .68fr;gap:.45rem}
.corrective-list-heading{padding:.25rem .45rem;color:var(--muted);font-size:.52rem;font-weight:900;text-transform:uppercase}
.corrective-cause-row{padding:.52rem;align-items:start;border:1px solid #d3e0da;border-radius:9px;background:#fff}
.corrective-cause-row label{display:grid;gap:.22rem;color:#294036;font-size:.56rem;font-weight:850}
.corrective-cause-row textarea,.corrective-cause-row select,.corrective-cause-row input{width:100%;min-height:40px;padding:.45rem .5rem;border:1px solid #c6d4cd;border-radius:8px;background:#fff;font:inherit;font-size:.59rem}
.corrective-cause-row textarea{resize:vertical}
.corrective-cause small,.corrective-cause strong{display:block}
.corrective-cause small{color:var(--muted);font-size:.5rem;text-transform:uppercase}
.corrective-cause strong{margin-top:.18rem;font-size:.6rem;line-height:1.4}
.corrective-validation-group{margin-top:.7rem}
.corrective-validation-group>strong{display:block;margin-bottom:.4rem;font-size:.69rem}

@media(max-width:700px){
  .analysis-method-selector>div{grid-template-columns:1fr}
  .five-why-shell{height:100dvh;min-height:100dvh;max-height:none}
  .five-why-board{overflow-x:auto}
  .five-why-grid{min-width:760px}
  .five-why-rows{min-height:calc(100dvh - 190px)}
  .corrective-list-heading{display:none}
  .corrective-cause-row{grid-template-columns:1fr}
}

/* Selector tradicional por radio para el método de evaluación */
.analysis-method-selector{padding:.62rem .7rem}.analysis-method-selector>div{display:flex;flex-wrap:wrap;gap:.7rem 1.5rem}.analysis-method-selector label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.48rem;cursor:pointer}.analysis-method-selector input{position:static;width:18px;height:18px;margin:0;opacity:1;accent-color:var(--green)}.analysis-method-selector span{min-height:0;padding:.12rem 0;border:0;border-radius:0;background:transparent;cursor:pointer}.analysis-method-selector span strong{font-size:.68rem}.analysis-method-selector span small{margin-top:.08rem;font-size:.52rem}.analysis-method-selector input:checked+span{border:0;background:transparent;box-shadow:none}.analysis-method-selector input:checked+span strong{color:var(--green)}.analysis-method-selector input:focus-visible{outline:3px solid #2f88682b;outline-offset:2px}.analysis-method-selector input:focus-visible+span{outline:0}
@media(max-width:700px){.analysis-method-selector>div{display:grid;grid-template-columns:1fr;gap:.6rem}}

/* Editor único de Ishikawa. */
.ishikawa-editor-dialog{width:min(1500px,99vw);max-height:96vh;border-radius:17px;background:#fff;color:var(--ink);box-shadow:0 25px 80px rgba(0,23,17,.48)}
.ishikawa-editor-shell{height:min(94vh,900px);display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.ishikawa-editor-board{overflow:auto;padding:.8rem;background:#f4f7f5}
.ishikawa-editor-columns{min-width:980px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:.65rem}
.ishikawa-editor-column{min-width:0;min-height:480px;padding:.5rem;display:flex;flex-direction:column;border:1px solid #c8d8d0;border-radius:12px;background:#fff}
.ishikawa-editor-column>header{min-height:58px;padding:.5rem;display:flex;align-items:center;justify-content:space-between;gap:.45rem;border-radius:9px;background:#0b5b45;color:#fff}
.ishikawa-editor-column>header>div{min-width:0;display:grid;gap:.12rem}
.ishikawa-editor-column>header strong{font-size:.72rem}
.ishikawa-editor-column>header small{color:#d8eee7;font-size:.5rem;font-weight:800}
.ishikawa-editor-column>header button{min-width:86px;height:34px;padding:0 .55rem;border:1px solid #ffffff80;border-radius:8px;background:#fff;color:#0b5b45;font-size:.62rem;font-weight:900;cursor:pointer}
.ishikawa-editor-rows{width:100%;min-height:395px;padding:.65rem 0 1rem;display:flex;flex-direction:column;align-items:stretch;gap:.65rem;overflow:visible}
.ishikawa-editor-row{width:100%;min-width:0;min-height:96px;flex:0 0 auto;padding:.75rem;display:flex;flex-direction:column;border:2px solid #111;border-radius:10px;background:#fff;color:#111;box-shadow:0 2px 7px rgba(13,54,40,.05)}
.ishikawa-editor-row.is-child{min-height:78px;margin:.6rem 0 0 .75rem;border-width:1px;border-color:#8eaaa0;background:#f8fbf9}
.ishikawa-editor-copy{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.5rem}
.ishikawa-editor-copy b{min-width:34px;padding:.22rem .3rem;border-radius:6px;background:#dff0e8;color:#0b5b45;font-size:.68rem;text-align:center}
.ishikawa-editor-copy span{min-width:0;color:#111;font-size:.74rem;font-weight:400;line-height:1.48;overflow-wrap:anywhere}
.ishikawa-editor-actions{margin-top:auto;padding-top:.55rem;display:flex;justify-content:flex-end;gap:.3rem}
.ishikawa-editor-actions button{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;font-weight:950;cursor:pointer}
.ishikawa-editor-edit{border:1px solid #9bbfd2;background:#eef7fc;color:#17668f}
.ishikawa-editor-add{border:1px solid #83b39f;background:var(--green-soft);color:var(--green)}
.ishikawa-editor-delete{border:1px solid #dfb5b5;background:#fff3f3;color:var(--red)}
.ishikawa-editor-delete.is-blocked{border-color:#d3d9d6;background:#f2f4f3;color:#8b9691}
.ishikawa-editor-children{margin-top:.45rem;padding-left:.45rem;display:grid;gap:.4rem;border-left:2px solid #b6d2c5}
.ishikawa-editor-empty{min-height:395px;display:grid;place-items:center;border:1px dashed #ccd9d3;border-radius:9px;background:#fbfcfb;color:var(--muted)}
.ishikawa-editor-row.is-new{animation:ishikawa-editor-new 1.1s ease-out}
@keyframes ishikawa-editor-new{0%{background:#dff5e9;box-shadow:0 0 0 3px #2c8b623d}100%{background:#fff;box-shadow:0 2px 7px rgba(13,54,40,.05)}}
.ishikawa-cause-dialog{width:min(640px,94vw)}
.ishikawa-cause-dialog textarea{width:100%;min-height:170px;padding:.65rem;border:2px solid #111;border-radius:9px;background:#fff;color:#111;resize:vertical;font:inherit;font-size:.74rem;line-height:1.48}
@media(max-width:700px){.ishikawa-editor-dialog{inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;border-radius:0}.ishikawa-editor-shell{height:100dvh}.ishikawa-editor-columns{min-width:920px}}

/* Acceso por usuario y biblioteca de lecciones aprendidas. */
.permission-locked{opacity:.58;filter:saturate(.55)}
.permission-disabled:disabled{opacity:.38!important;cursor:not-allowed!important;filter:grayscale(.4)}
.user-row-actions{align-items:center;flex-wrap:wrap;justify-content:flex-end}
.user-row-actions .user-permissions-button{width:auto;height:34px;padding:0 .65rem;border-color:#9fc7b5;background:#edf8f2;color:var(--green);font-size:.58rem;font-weight:900}
.permission-form-body{display:grid;gap:.65rem}
.permission-check{min-height:66px;padding:.68rem;display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.65rem;border:1px solid #c7d7cf;border-radius:10px;background:#fff;cursor:pointer}
.permission-check.administrator{border-color:#91bba8;background:#f1faf5}
.permission-check input{width:20px!important;min-height:20px!important;height:20px;margin:0;accent-color:var(--green)}
.permission-check span,.permission-check strong,.permission-check small{display:block}
.permission-check strong{font-size:.69rem}.permission-check small{margin-top:.14rem;color:var(--muted);font-size:.56rem;line-height:1.4}
.standard-permissions{display:grid;gap:.55rem}.standard-permissions[hidden]{display:none!important}
.login-dialog{width:min(520px,94vw)}
.login-dialog form{display:grid;grid-template-rows:auto auto auto}
.login-body{display:grid;gap:.65rem}.login-body label{display:grid;gap:.28rem}.login-body input{width:100%}
.bootstrap-admin-help{padding:.55rem .65rem;border:1px solid #e0c17e;border-radius:8px;background:#fff8e7;color:#755315;font-size:.58rem;font-weight:800;line-height:1.4}
.lessons-library-dialog{width:min(1180px,96vw)}
.lessons-library-content{display:grid;grid-template-rows:auto minmax(0,1fr);gap:.7rem}
.lessons-line-filter{width:min(420px,100%);display:grid;gap:.28rem;color:#294036;font-size:.62rem;font-weight:900}
.lessons-line-filter select{width:100%;min-height:42px;padding:.5rem .58rem;border:1px solid #c6d4cd;border-radius:8px;background:#fff}
.lessons-library-list{display:grid;align-content:start;gap:.5rem}
.lesson-library-row{padding:.65rem;display:grid;grid-template-columns:minmax(105px,.65fr) minmax(180px,1.1fr) minmax(260px,1.6fr) auto;align-items:center;gap:.7rem;border:1px solid var(--line);border-radius:10px;background:#fff}
.lesson-library-row small,.lesson-library-row strong,.lesson-library-row span{display:block}.lesson-library-row small{color:var(--muted);font-size:.52rem;font-weight:900;text-transform:uppercase}.lesson-library-row strong{margin-top:.12rem;font-size:.65rem;line-height:1.42;overflow-wrap:anywhere}.lesson-library-row span{margin-top:.1rem;color:var(--muted);font-size:.55rem}
.lesson-library-row>button{width:38px;height:38px;border:1px solid #a9cabb;border-radius:9px;background:#f2faf6;color:var(--green);cursor:pointer}
@media(max-width:700px){.user-row-actions{max-width:116px}.user-row-actions .user-permissions-button{width:100%}.lesson-library-row{grid-template-columns:1fr auto}.lesson-library-row>div{grid-column:1}.lesson-library-row>button{grid-column:2;grid-row:1/4}.lessons-library-dialog .directory-shell{height:100dvh}}
