/* 🔬INV_v0.81 - Estilos aislados del módulo FONDEP */
:root{
  --fondep-blue:#0969da;
  --fondep-cyan:#38bdf8;
  --fondep-navy:#0f172a;
  --fondep-soft:#f8fbff;
  --fondep-border:#dbeafe;
  --fondep-text:#1f2937;
  --fondep-muted:#64748b;
}
.fondep-page{background:linear-gradient(180deg,#f6faff 0%,#eef6ff 100%);color:var(--fondep-text);}
.fondep-shell{min-height:100vh;display:flex;flex-direction:column;}
.fondep-layout{display:grid;grid-template-columns:290px minmax(0,1fr);gap:18px;padding:18px;max-width:1480px;width:100%;margin:0 auto;box-sizing:border-box;}
.fondep-sidebar{position:sticky;top:92px;align-self:start;max-height:calc(100vh - 110px);overflow:auto;background:#fff;border:1px solid var(--fondep-border);border-radius:18px;padding:14px;box-shadow:0 16px 38px rgba(15,23,42,.08);}
.fondep-brand{display:flex;gap:12px;align-items:center;padding:12px;border-radius:16px;background:linear-gradient(135deg,#eff6ff,#ecfeff);border:1px solid #bfdbfe;margin-bottom:12px;}
.fondep-brand i{font-size:24px;color:var(--fondep-blue);}
.fondep-brand strong{display:block;color:var(--fondep-navy);font-size:16px;}
.fondep-brand span{display:block;color:var(--fondep-muted);font-size:12px;margin-top:2px;}
.fondep-nav{display:flex;flex-direction:column;gap:8px;}
.fondep-nav button{width:100%;border:1px solid #e2e8f0;background:#fff;color:#334155;padding:11px 12px;border-radius:13px;text-align:left;display:flex;align-items:center;gap:9px;cursor:pointer;font-weight:700;transition:.18s ease;}
.fondep-nav button:hover{border-color:#93c5fd;background:#f0f9ff;transform:translateX(2px);}
.fondep-nav button.active{background:linear-gradient(135deg,#0969da,#0284c7);color:#fff;border-color:#0969da;box-shadow:0 10px 22px rgba(9,105,218,.18);}
.fondep-main{min-width:0;display:flex;flex-direction:column;gap:16px;}
.fondep-hero{background:#fff;border:1px solid var(--fondep-border);border-radius:22px;padding:22px;box-shadow:0 18px 45px rgba(15,23,42,.08);display:flex;justify-content:space-between;gap:18px;align-items:flex-start;}
.fondep-eyebrow{display:inline-flex;align-items:center;gap:8px;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;border-radius:999px;padding:6px 11px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.fondep-hero h2{margin:12px 0 8px;color:var(--fondep-navy);font-size:30px;line-height:1.1;}
.fondep-hero p{margin:0;color:#475569;line-height:1.55;max-width:820px;}
.fondep-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.fondep-btn{border:1px solid #bfdbfe;background:#fff;color:#0f4f9e;border-radius:12px;padding:10px 12px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:.18s ease;}
.fondep-btn:hover{background:#eff6ff;transform:translateY(-1px);}
.fondep-btn.primary{background:linear-gradient(135deg,#0969da,#0284c7);border-color:#0969da;color:#fff;}
.fondep-btn.danger{background:#fff1f2;border-color:#fecdd3;color:#be123c;}
.fondep-section{display:none;}
.fondep-section.active{display:block;}
.fondep-card{background:#fff;border:1px solid var(--fondep-border);border-radius:20px;padding:18px;box-shadow:0 14px 36px rgba(15,23,42,.07);margin-bottom:16px;}
.fondep-card h3{margin:0 0 10px;color:var(--fondep-navy);display:flex;align-items:center;gap:9px;}
.fondep-card h4{margin:0 0 8px;color:#0f4f9e;}
.fondep-card p{line-height:1.55;color:#475569;}
.fondep-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.fondep-mini-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.fondep-mini-card{border:1px solid #dbeafe;background:#f8fbff;border-radius:16px;padding:14px;}
.fondep-mini-card strong{display:block;color:#0f172a;margin-bottom:6px;}
.fondep-mini-card span{color:#64748b;font-size:13px;line-height:1.45;}
.fondep-list{margin:8px 0 0;padding-left:20px;color:#475569;line-height:1.6;}
.fondep-flow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px;}
.fondep-flow-step{border:1px solid #bfdbfe;background:linear-gradient(180deg,#ffffff,#eff6ff);border-radius:16px;padding:13px;}
.fondep-flow-step b{display:block;color:#0969da;font-size:12px;text-transform:uppercase;letter-spacing:.03em;margin-bottom:6px;}
.fondep-flow-step strong{display:block;color:#0f172a;}
.fondep-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.fondep-field{display:flex;flex-direction:column;gap:6px;}
.fondep-field.full{grid-column:1/-1;}
.fondep-field label{font-size:13px;font-weight:800;color:#334155;}
.fondep-field input,.fondep-field select,.fondep-field textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:12px;padding:10px 11px;font:inherit;background:#fff;color:#111827;outline:none;}
.fondep-field textarea{min-height:94px;resize:vertical;}
.fondep-field input:focus,.fondep-field select:focus,.fondep-field textarea:focus{border-color:#38bdf8;box-shadow:0 0 0 3px rgba(56,189,248,.18);}
.fondep-group-title{grid-column:1/-1;margin:8px 0 0;padding:10px 12px;border-radius:14px;background:#eff6ff;border:1px solid #bfdbfe;color:#0f4f9e;font-weight:900;display:flex;gap:8px;align-items:center;}
.fondep-prompt-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;}
.fondep-prompt-card{border:1px solid #dbeafe;border-radius:18px;background:#fff;overflow:hidden;box-shadow:0 12px 30px rgba(15,23,42,.06);}
.fondep-prompt-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:14px 16px;background:linear-gradient(135deg,#eff6ff,#ecfeff);border-bottom:1px solid #dbeafe;}
.fondep-prompt-head h4{margin:0;color:#0f172a;}
.fondep-prompt-head small{display:block;margin-top:4px;color:#64748b;font-weight:700;}
.fondep-prompt-output{white-space:pre-wrap;background:#0f172a;color:#e5f3ff;padding:16px;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:13px;line-height:1.55;max-height:440px;overflow:auto;}
.fondep-texts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.fondep-text-card{border:1px solid #dbeafe;background:#fff;border-radius:18px;padding:14px;}
.fondep-text-card textarea{width:100%;min-height:210px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:12px;padding:10px;resize:vertical;font:inherit;}
.fondep-copy-note{font-size:12px;color:#64748b;margin-top:8px;}
.fondep-map-code{background:#0f172a;color:#e2e8f0;border-radius:16px;padding:14px;white-space:pre-wrap;overflow:auto;font-size:12px;line-height:1.55;}
.fondep-toast{position:fixed;right:18px;bottom:18px;background:#0f172a;color:#fff;border-radius:999px;padding:10px 14px;box-shadow:0 18px 40px rgba(15,23,42,.28);opacity:0;pointer-events:none;transform:translateY(10px);transition:.2s ease;z-index:9999;}
.fondep-toast.show{opacity:1;transform:translateY(0);}
.fondep-page ::-webkit-scrollbar{width:10px;height:10px;}
.fondep-page ::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#38bdf8,#0969da);border-radius:999px;border:2px solid #e0f2fe;}
.fondep-page ::-webkit-scrollbar-track{background:#e0f2fe;border-radius:999px;}
@media(max-width:1050px){.fondep-layout{grid-template-columns:1fr}.fondep-sidebar{position:relative;top:auto;max-height:none}.fondep-hero{flex-direction:column}.fondep-actions{justify-content:flex-start}.fondep-mini-grid,.fondep-flow{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:700px){.fondep-layout{padding:12px}.fondep-grid,.fondep-form-grid,.fondep-texts,.fondep-mini-grid,.fondep-flow{grid-template-columns:1fr}.fondep-hero h2{font-size:24px}.fondep-prompt-head{flex-direction:column}}


/* v0.81 - Pestañas internas por sesión y labels de sustitución */
.fondep-session-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 14px;background:#ffffff;border:1px solid #dbeafe;border-radius:18px;padding:8px;box-shadow:0 12px 30px rgba(15,23,42,.06);}
.fondep-session-tabs button{border:1px solid #dbeafe;background:#f8fbff;color:#0f4f9e;border-radius:13px;padding:10px 13px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:.18s ease;}
.fondep-session-tabs button:hover{background:#eff6ff;border-color:#93c5fd;transform:translateY(-1px);}
.fondep-session-tabs button.active{background:linear-gradient(135deg,#0969da,#0284c7);color:#fff;border-color:#0969da;box-shadow:0 10px 22px rgba(9,105,218,.18);}
.fondep-tab-panel{display:none;}
.fondep-tab-panel.active{display:block;}
.fondep-step-pill{display:inline-flex;align-items:center;justify-content:center;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;border-radius:999px;padding:2px 8px;margin-right:6px;font-size:12px;font-weight:900;}
.fondep-prompt-substitutions{background:#f8fbff;border-bottom:1px solid #dbeafe;padding:10px 14px;}
.fondep-substitution-toggle{border:1px solid #bfdbfe;background:#ffffff;color:#0f4f9e;border-radius:999px;padding:7px 11px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;gap:8px;}
.fondep-substitution-toggle:hover{background:#eff6ff;}
.fondep-substitution-toggle b{background:#e0f2fe;color:#075985;border-radius:999px;padding:1px 7px;font-size:12px;}
.fondep-substitution-panel{display:none;flex-wrap:wrap;gap:8px;margin-top:10px;}
.fondep-substitution-panel.open{display:flex;}
.fondep-chip{display:inline-flex;align-items:center;gap:4px;border:1px solid #dbeafe;background:#ffffff;color:#334155;border-radius:999px;padding:7px 10px;font-size:12px;max-width:100%;}
.fondep-chip strong{color:#0f4f9e;}
.fondep-chip.pending{background:#fff7ed;border-color:#fed7aa;color:#9a3412;}
.fondep-chip.pending strong{color:#c2410c;}
.fondep-chip.filled{background:#ecfdf5;border-color:#bbf7d0;color:#166534;}
.fondep-chip.filled strong{color:#15803d;}
.fondep-replaced-value{background:#fde68a;color:#111827;border-radius:5px;padding:0 3px;}
.fondep-welcome-card{border-color:#bfdbfe;background:linear-gradient(180deg,#ffffff,#f8fbff);}
.fondep-mini-grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
@media(max-width:700px){.fondep-session-tabs{flex-direction:column}.fondep-session-tabs button{width:100%;justify-content:center}.fondep-mini-grid-3{grid-template-columns:1fr}}

/* v0.82 - Prompts FONDEP guiados por pasos, checks y respuesta vinculada a Textos A-L */
.fondep-tab-count{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:22px;padding:0 7px;border-radius:999px;background:rgba(255,255,255,.24);font-size:12px;font-weight:900;}
.fondep-progress-line{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;height:28px;margin:12px 0 14px;padding:0 10px;border-radius:999px;background:#e0f2fe;overflow:hidden;color:#075985;font-size:12px;font-weight:900;}
.fondep-progress-line span{position:relative;z-index:1;}
.fondep-progress-line b{position:absolute;left:0;top:0;bottom:0;background:linear-gradient(135deg,#bae6fd,#38bdf8);border-radius:999px;transition:width .22s ease;}
.fondep-prompt-intro{border-color:#bfdbfe;background:linear-gradient(180deg,#ffffff,#f8fbff);}
.fondep-prompt-workbench{display:flex;flex-direction:column;gap:12px;}
.fondep-prompt-workbench-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;background:#ffffff;border:1px solid #dbeafe;border-radius:18px;padding:14px 16px;box-shadow:0 12px 30px rgba(15,23,42,.05);}
.fondep-prompt-workbench-head strong{display:block;color:#0f172a;font-size:15px;}
.fondep-prompt-workbench-head span{display:block;color:#64748b;font-size:13px;margin-top:3px;}
.fondep-status-badge{display:inline-flex!important;align-items:center;justify-content:center;white-space:nowrap;background:#ecfdf5;color:#166534;border:1px solid #bbf7d0;border-radius:999px;padding:7px 11px;font-size:12px!important;font-weight:900;}
.fondep-prompt-step-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;background:#ffffff;border:1px solid #dbeafe;border-radius:18px;padding:10px;box-shadow:0 12px 30px rgba(15,23,42,.06);}
.fondep-prompt-step-tab{border:1px solid #dbeafe;background:#f8fbff;color:#0f4f9e;border-radius:15px;padding:10px;display:flex;align-items:center;gap:9px;text-align:left;cursor:pointer;transition:.18s ease;min-height:64px;}
.fondep-prompt-step-tab:hover{background:#eff6ff;border-color:#93c5fd;transform:translateY(-1px);}
.fondep-prompt-step-tab.active{background:linear-gradient(135deg,#0969da,#0284c7);color:#fff;border-color:#0969da;box-shadow:0 12px 24px rgba(9,105,218,.18);}
.fondep-prompt-step-tab.done:not(.active){background:#ecfdf5;border-color:#86efac;color:#166534;}
.fondep-prompt-step-tab.pending:not(.active):not(.done){background:#fff7ed;border-color:#fed7aa;color:#9a3412;}
.fondep-prompt-step-tab span:last-child{min-width:0;}
.fondep-prompt-step-tab b{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.03em;}
.fondep-prompt-step-tab small{display:block;font-size:11px;line-height:1.25;white-space:normal;opacity:.88;margin-top:2px;}
.fondep-step-check{flex:0 0 auto;width:24px;height:24px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#ffffff;border:1px solid #bfdbfe;color:#0f4f9e;font-size:12px;}
.fondep-prompt-step-tab.active .fondep-step-check{background:rgba(255,255,255,.22);border-color:rgba(255,255,255,.55);color:#fff;}
.fondep-prompt-step-tab.done:not(.active) .fondep-step-check{background:#dcfce7;border-color:#86efac;color:#15803d;}
.fondep-active-prompt-stage{min-width:0;}
.fondep-output-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px 14px;background:#ffffff;border-bottom:1px solid #dbeafe;}
.fondep-output-summary div{background:#f8fbff;border:1px solid #dbeafe;border-radius:14px;padding:11px;}
.fondep-output-summary strong{display:flex;align-items:center;gap:7px;color:#0f4f9e;margin-bottom:5px;font-size:13px;}
.fondep-output-summary span{display:block;color:#475569;font-size:12px;line-height:1.42;}
.fondep-prompt-preview-block{border-bottom:1px solid #dbeafe;}
.fondep-block-title{background:#f8fbff;color:#0f4f9e;font-weight:900;padding:10px 14px;border-bottom:1px solid #dbeafe;display:flex;align-items:center;gap:8px;}
.fondep-response-block{padding:14px;background:#ffffff;}
.fondep-response-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.fondep-response-head strong{display:flex;align-items:center;gap:8px;color:#0f172a;}
.fondep-response-head span{display:block;color:#64748b;font-size:12px;line-height:1.4;margin-top:3px;}
.fondep-response-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.fondep-response-counter{display:inline-flex!important;align-items:center;justify-content:center;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;border-radius:999px;padding:6px 10px;font-size:12px!important;font-weight:900;white-space:nowrap;}
.fondep-response-area{width:100%;min-height:220px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:14px;padding:12px;font:inherit;line-height:1.5;resize:vertical;outline:none;background:#fff;color:#111827;}
.fondep-response-area:focus{border-color:#38bdf8;box-shadow:0 0 0 3px rgba(56,189,248,.18);}
.fondep-highlight-card{box-shadow:0 0 0 4px rgba(56,189,248,.24),0 16px 38px rgba(15,23,42,.08)!important;border-color:#38bdf8!important;}
@media(max-width:1050px){.fondep-prompt-step-tabs{grid-template-columns:repeat(2,minmax(0,1fr));}.fondep-output-summary{grid-template-columns:1fr}.fondep-response-head{flex-direction:column}.fondep-response-actions{justify-content:flex-start}.fondep-prompt-workbench-head{flex-direction:column}}
@media(max-width:700px){.fondep-prompt-step-tabs{grid-template-columns:1fr}.fondep-prompt-step-tab{min-height:auto}.fondep-response-actions .fondep-btn{width:100%;justify-content:center}}

/* v0.84 - Limpieza FONDEP: acciones en sidebar, prompts con pestañas Prompt/Respuesta y labels heredables */
.fondep-sidebar-actions{display:grid;grid-template-columns:1fr;gap:8px;margin:12px 0;padding:12px;border:1px solid #dbeafe;border-radius:16px;background:#f8fbff;}
.fondep-sidebar-actions .fondep-btn{width:100%;justify-content:center;padding:9px 10px;}
.fondep-hero{padding:18px 20px;}
.fondep-hero h2{font-size:26px;}
.fondep-session-header-card{background:#fff;border:1px solid var(--fondep-border);border-radius:22px;padding:18px 20px;box-shadow:0 14px 36px rgba(15,23,42,.07);margin-bottom:14px;display:flex;align-items:flex-start;justify-content:space-between;gap:18px;}
.fondep-session-header-card h2{margin:10px 0 7px;color:#0f172a;font-size:25px;line-height:1.12;}
.fondep-session-header-card p{margin:0;color:#475569;line-height:1.55;}
.fondep-session-score{flex:0 0 auto;min-width:116px;text-align:center;border:1px solid #bae6fd;background:#eff6ff;border-radius:16px;padding:12px;color:#075985;}
.fondep-session-score strong{display:block;font-size:24px;line-height:1;color:#0969da;}
.fondep-session-score span{display:block;margin-top:5px;font-size:12px;font-weight:800;color:#075985;}
.fondep-prompt-workbench.clean{display:flex;flex-direction:column;gap:12px;}
.fondep-prompt-head.clean{background:linear-gradient(135deg,#ffffff,#f8fbff);}
.fondep-prompt-head.clean small{max-width:820px;line-height:1.45;}
.fondep-prompt-inner-tabs{display:flex;gap:8px;flex-wrap:wrap;padding:10px 12px;background:#fff;border-bottom:1px solid #dbeafe;}
.fondep-prompt-inner-tabs button{border:1px solid #dbeafe;background:#f8fbff;color:#0f4f9e;border-radius:12px;padding:9px 12px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:.18s ease;}
.fondep-prompt-inner-tabs button:hover{background:#eff6ff;border-color:#93c5fd;transform:translateY(-1px);}
.fondep-prompt-inner-tabs button.active{background:linear-gradient(135deg,#0969da,#0284c7);border-color:#0969da;color:#fff;box-shadow:0 10px 20px rgba(9,105,218,.16);}
.fondep-small-check{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;background:#dcfce7;color:#15803d;font-size:10px;}
.fondep-prompt-inner-tabs button.active .fondep-small-check{background:rgba(255,255,255,.24);color:#fff;}
.fondep-prompt-panel{display:none;}
.fondep-prompt-panel.active{display:block;}
.fondep-output-summary.compact-summary{grid-template-columns:1.2fr .85fr .85fr;}
.fondep-label-editor{padding:14px;background:#ffffff;border-bottom:1px solid #dbeafe;}
.fondep-label-editor h5,.fondep-required-texts h5{margin:0 0 7px;color:#0f4f9e;font-size:14px;display:flex;align-items:center;gap:8px;}
.fondep-label-editor p{margin:0 0 12px;color:#64748b;font-size:13px;line-height:1.45;}
.fondep-label-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.fondep-field.compact label{font-size:12px;}
.fondep-field.compact input,.fondep-field.compact select,.fondep-field.compact textarea{font-size:13px;padding:9px 10px;border-radius:11px;}
.fondep-field.compact textarea{min-height:76px;}
.fondep-required-texts{padding:14px;background:#ffffff;border-bottom:1px solid #dbeafe;}
.fondep-chip-wrap{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 10px;}
.fondep-block-title span{margin-left:auto;color:#64748b;font-size:12px;font-weight:700;}
.fondep-response-block.solo{padding:16px;}
.fondep-text-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:8px;}
.fondep-text-card-head h4{margin:0;color:#0f4f9e;}
.fondep-text-card-head span{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;padding:4px 8px;font-size:11px;font-weight:900;white-space:nowrap;}
.fondep-text-helper{margin:0 0 9px;color:#64748b;font-size:12px;line-height:1.45;}
.fondep-text-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px;}
.fondep-text-actions .fondep-btn{padding:8px 10px;font-size:12px;}
@media(max-width:1050px){.fondep-session-header-card{flex-direction:column}.fondep-session-score{text-align:left}.fondep-label-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.fondep-output-summary.compact-summary{grid-template-columns:1fr;}}
@media(max-width:700px){.fondep-label-grid{grid-template-columns:1fr}.fondep-prompt-inner-tabs{display:grid;grid-template-columns:1fr}.fondep-prompt-inner-tabs button{justify-content:center}.fondep-session-header-card h2{font-size:22px}}
