/* ==========================================================================
   SECPLAM · CONTROL DE DISEÑO (.dx-) Y CABECERA FIJA DE LA INICIATIVA (.ci-)
   ========================================================================== */
/* Cabecera fija: nombre de la iniciativa + pestañas siempre visibles */
.ci-stick { position: sticky; top: -40px; z-index: 40; margin: 0 -40px 14px; padding: 12px 40px 0; background: var(--bg-app); border-bottom: 1px solid var(--border-color); box-shadow: 0 8px 14px -12px rgba(15, 23, 42, 0.25); }
.ci-stick .gx-tabs { margin: 6px 0 0; border-bottom: none; }
.ci-stick-h { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; align-items: center; background: #fff; border: 1px solid var(--border-color); border-left: 5px solid var(--c, var(--primary-start)); border-radius: 12px; padding: 10px 14px; }
.ci-et { grid-row: 1 / 3; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 0.78rem; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); border-radius: 10px; padding: 6px 10px; min-width: 96px; }
.ci-et b { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 0.68rem; margin-bottom: 2px; }
.ci-et small { font-size: 0.66rem; font-weight: 600; color: var(--text-muted); }
.ci-nombre { font-size: 1.02rem; font-weight: 800; color: var(--text-main); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.ci-meta { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) { .ci-stick { margin: 0 -20px 12px; padding: 8px 20px 0; top: -20px; } .ci-stick-h { grid-template-columns: 1fr; } .ci-et { grid-row: auto; flex-direction: row; align-items: center; gap: 6px; } .ci-nombre { font-size: 0.92rem; } }
@media print { .ci-stick { position: static; box-shadow: none; } }

/* Ejecución: barra de acciones fija con el nombre de la obra */
.ex-dash-actions.ex-stick { position: sticky; top: -40px; z-index: 40; margin: 0 -40px; padding: 10px 40px; background: var(--bg-app); border-bottom: 1px solid var(--border-color); box-shadow: 0 8px 14px -12px rgba(15, 23, 42, 0.25); flex-wrap: wrap; gap: 10px; }
.ex-stick-name { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 800; color: var(--text-main); }
.ex-stick-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) { .ex-dash-actions.ex-stick { margin: 0 -20px; padding: 8px 20px; top: -20px; } }

/* Panel de control de diseño */
.dx-panel { display: flex; flex-direction: column; gap: 16px; }
.dx-sit { border-top: 4px solid var(--sem); padding: 16px 18px !important; }
.dx-sit-h { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.dx-sit-h h3 { font-size: 1rem; font-weight: 800; color: var(--text-main); margin: 6px 0 2px; }
.dx-motivo { font-size: 0.82rem; color: var(--text-main); max-width: 90ch; }
.dx-sit-act { display: flex; gap: 8px; flex-wrap: wrap; }
.dx-sem { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; color: var(--sem); background: color-mix(in srgb, var(--sem) 10%, #fff); padding: 3px 10px; border-radius: 999px; }
.dx-sem span { width: 8px; height: 8px; border-radius: 50%; background: var(--sem); }
.dx-steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin: 14px 0 10px; }
.dx-step { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px 2px; border-radius: 8px; background: #f1f5f9; color: var(--text-muted); min-width: 0; }
.dx-step b { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; background: #cbd5e1; color: #fff; }
.dx-step span { font-size: 0.64rem; font-weight: 600; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dx-step.ok { background: #ecfdf5; color: #047857; } .dx-step.ok b { background: #059669; }
.dx-step.cur { background: #eff6ff; color: #1d4ed8; outline: 2px solid #3b82f6; } .dx-step.cur b { background: #2563eb; }
.dx-sit-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.8rem; color: var(--text-muted); }
.dx-sit-foot span { display: inline-flex; align-items: center; gap: 6px; }
.dx-sit-foot svg { width: 15px; height: 15px; }
.dx-sit-foot strong { color: var(--text-main); }
.dx-prox { flex-basis: 100%; color: var(--text-main) !important; background: #f8fafc; border-radius: 8px; padding: 7px 10px; }
.dx-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.dx-kpi { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dx-kpi span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.dx-kpi strong { font-size: 1.25rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dx-kpi small { font-size: 0.7rem; color: var(--text-muted); }
.dx-kpi.bad strong { color: #b91c1c; }
.dx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dx-sec { padding: 16px 18px !important; }
.dx-sec h4 { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }
.dx-sec h4 svg { width: 17px; height: 17px; color: var(--primary-start); }
.dx-sec h4 small { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-left: auto; }
.dx-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.dx-dl dt { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.dx-dl dd { font-size: 0.84rem; color: var(--text-main); font-weight: 600; margin: 1px 0 0; overflow-wrap: anywhere; }
.dx-falta { font-style: normal; font-weight: 500; color: #b45309; }
.dx-vacio { font-size: 0.8rem; color: var(--text-muted); }
.dx-plazo { margin-top: 12px; font-size: 0.74rem; color: var(--text-muted); }
.dx-bar { height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; margin-top: 5px; }
.dx-bar i { display: block; height: 100%; border-radius: 5px; }
.dx-tw { overflow-x: auto; }
.dx-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dx-table th { text-align: left; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.dx-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); vertical-align: top; color: var(--text-main); }
.dx-table td small { display: block; font-size: 0.68rem; color: var(--text-muted); }
.dx-table .t-r { text-align: right; }
.dx-row-bad td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.dx-bad { color: #b91c1c !important; font-weight: 700; }
.dx-chip { display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dx-esp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dx-esp li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-color); font-size: 0.82rem; color: var(--text-main); }
.dx-esp li:last-child { border-bottom: none; }
.dx-esp li small { display: block; font-size: 0.68rem; color: var(--text-muted); }
.dx-alertas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dx-alertas li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8rem; line-height: 1.4; padding: 7px 10px; border-radius: 8px; background: #f8fafc; color: var(--text-main); }
.dx-alertas svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.dx-al-critico { background: #fef2f2 !important; } .dx-al-critico svg { color: #dc2626; }
.dx-al-riesgo { background: #fff7ed !important; } .dx-al-riesgo svg { color: #ea580c; }
.dx-al-atencion { background: #fefce8 !important; } .dx-al-atencion svg { color: #ca8a04; }
.dx-al-info svg { color: #2563eb; } .dx-al-ok svg { color: #059669; }
.dx-notas { margin-top: 10px; font-size: 0.78rem; color: var(--text-main); }
.dx-pie { font-size: 0.72rem; color: var(--text-muted); }
/* Editor */
.dx-eh { font-size: 0.82rem; font-weight: 800; color: var(--text-main); margin: 6px 0 10px; }
.dx-eh small { font-weight: 500; color: var(--text-muted); }
.dx-eh:not(:first-child) { margin-top: 18px; }
.dx-full { margin-top: 14px; }
.dx-full textarea { font-family: inherit; font-size: 0.86rem; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; width: 100%; resize: vertical; }
.dx-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dx-er { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) 34px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border-color); border-radius: 10px; background: #f8fafc; }
.dx-er > .ex-f:first-child { grid-column: span 2; }
.dx-chk { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--text-main); padding-bottom: 9px; }
@media (max-width: 1280px) { .dx-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .dx-two { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .dx-kpis { grid-template-columns: 1fr 1fr; } .dx-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); } .dx-dl { grid-template-columns: 1fr; } .dx-er > .ex-f:first-child { grid-column: auto; } }

/* Tarjeta de la vista «En diseño» */
.dx-card { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 0.72rem; color: var(--text-muted); background: #f8fafc; border: 1px solid var(--border-color); border-left: 3px solid var(--sem); border-radius: 8px; padding: 6px 9px; margin: 2px 0 8px; }
.dx-card span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.dx-card svg { width: 13px; height: 13px; }
.dx-card em { font-style: normal; color: #b45309; }
.dx-card-sem { font-weight: 800; color: var(--sem); }
.dx-card-sem span { width: 7px; height: 7px; border-radius: 50%; background: var(--sem); }
