/* ==========================================================================
   SECPLAM · MÓDULO EJECUCIÓN — estilos con prefijo .ex- (no afecta otras vistas)
   ========================================================================== */
#view-execution { --ex-ink: #0f172a; --ex-soft: #f8fafc; --ex-line: #e2e8f0; --ex-muted: #64748b; }

#view-execution .card { padding: 20px 22px; }
.ex-muted { color: var(--text-muted); }
.ex-muted.small, .ex-help { font-size: 0.8rem; }
.ex-help { color: var(--text-muted); margin: 4px 0 14px; line-height: 1.5; }
.ex-btn-sm { padding: 7px 12px !important; font-size: 0.8rem !important; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ex-btn-sm svg { width: 14px; height: 14px; }
.ex-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--sem, #94a3b8); flex-shrink: 0; }

/* --- Barra superior de la lista --- */
.ex-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ex-toolbar h2 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.ex-toolbar p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.ex-toolbar-right, .ex-dash-actions-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-corte { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); font-weight: 600; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 3px 4px 3px 10px; }
.ex-corte input { border: none; font-family: inherit; font-size: 0.82rem; font-weight: 700; color: var(--primary-start); padding: 4px 6px; background: rgba(15, 76, 129, 0.06); border-radius: 6px; }
.ex-search { position: relative; }
.ex-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); pointer-events: none; }
.ex-search input { width: 250px; max-width: 100%; padding: 8px 10px 8px 30px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 0.82rem; }
.ex-search input:focus, .ex-corte input:focus, .ex-f input:focus, .ex-f select:focus { outline: 2px solid rgba(15, 76, 129, 0.35); outline-offset: 1px; }

.ex-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ex-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-color); background: #fff; color: var(--text-main); border-radius: 999px; padding: 6px 12px; font-family: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.ex-chip strong { font-weight: 800; color: var(--text-muted); }
.ex-chip.active { background: var(--primary-start); border-color: var(--primary-start); color: #fff; }
.ex-chip.active strong { color: rgba(255, 255, 255, 0.8); }
.ex-chip:focus-visible, .ex-card:focus-visible, .ex-photo:focus-visible, .ex-tab:focus-visible { outline: 2px solid var(--primary-start); outline-offset: 2px; }

/* --- Tarjetas de obra --- */
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-card { background: #fff; border: 1px solid var(--border-color); border-left: 5px solid var(--sem); border-radius: 12px; padding: 16px 20px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; }
.ex-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07); border-color: var(--border-color-hover); border-left-color: var(--sem); }
.ex-card-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ex-card-title h3 { font-size: 0.98rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.ex-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 0.78rem; color: var(--text-muted); }
.ex-card-meta em { color: #b45309; font-style: normal; }
.ex-sem-pill { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 5px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; color: var(--sem); background: color-mix(in srgb, var(--sem) 11%, #fff); border: 1px solid color-mix(in srgb, var(--sem) 30%, #fff); }
.ex-sem-pill.big { font-size: 0.82rem; padding: 6px 13px; }

.ex-mini { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin: 14px 0 12px; }
.ex-mini-date { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.ex-mini-track { position: relative; height: 16px; background: #eef2f7; border-radius: 8px; }
.ex-mini-time { position: absolute; left: 0; top: 0; bottom: 0; background: #cbd5e1; border-radius: 8px; }
.ex-mini-phys { position: absolute; left: 0; top: 5px; height: 6px; border-radius: 3px; }
.ex-mini-today { position: absolute; top: -4px; width: 3px; height: 24px; background: var(--ex-ink); border-radius: 2px; transform: translateX(-50%); }
.ex-mini-today.is-over { background: #dc2626; }
.ex-mini-empty { margin: 12px 0; font-size: 0.78rem; color: var(--text-muted); padding: 8px 12px; background: var(--ex-soft); border: 1px dashed var(--border-color); border-radius: 8px; }

.ex-card-figs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.ex-card-figs div { display: flex; flex-direction: column; gap: 2px; }
.ex-card-figs span { font-size: 0.7rem; color: var(--text-muted); }
.ex-card-figs strong { font-size: 0.95rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.is-bad { color: #dc2626 !important; }
.is-good { color: #059669 !important; }
.ex-card-foot { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-color); flex-wrap: wrap; }
.ex-state { font-size: 0.74rem; font-weight: 700; color: var(--primary-start); background: rgba(15, 76, 129, 0.07); padding: 3px 9px; border-radius: 6px; }
.ex-card-alert { font-size: 0.78rem; color: var(--text-muted); }
.ex-card-alert.lvl-critico { color: #dc2626; font-weight: 600; }
.ex-card-alert.lvl-riesgo { color: #c2410c; font-weight: 600; }
.ex-card-alert.lvl-atencion { color: #a16207; }
.ex-card-alert.lvl-ok { color: #059669; }

.ex-empty { text-align: center; padding: 48px 20px !important; color: var(--text-muted); }
.ex-empty svg { width: 36px; height: 36px; color: #94a3b8; margin-bottom: 10px; }
.ex-empty h3 { color: var(--text-main); font-size: 1rem; margin-bottom: 4px; }

/* --- Dashboard del proyecto --- */
.ex-dash { display: flex; flex-direction: column; gap: 16px; animation: exIn 0.28s ease-out; }
@keyframes exIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ex-dash { animation: none; } .ex-ring-fg { transition: none !important; } }
.ex-dash-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-dash-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.ex-dash-actions .btn svg { width: 16px; height: 16px; }

.ex-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border-top: 4px solid var(--sem); }
.ex-head h2 { font-size: 1.35rem; font-weight: 800; color: var(--text-main); line-height: 1.25; margin: 10px 0 14px; max-width: 70ch; }
.ex-head-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; }
.ex-head-meta dt, .ex-info dt { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.ex-head-meta dd, .ex-info dd { font-size: 0.86rem; color: var(--text-main); font-weight: 600; margin-top: 1px; word-break: break-word; }
.ex-head-why { margin-top: 14px; font-size: 0.82rem; color: var(--text-muted); }
.ex-ring { width: 150px; height: 150px; display: block; }
.ex-ring-bg { fill: none; stroke: #eef2f7; stroke-width: 11; }
.ex-ring-fg { fill: none; stroke-width: 11; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset 0.8s ease; }
.ex-ring-val { font-size: 30px; font-weight: 800; fill: var(--text-main); font-family: 'Outfit', sans-serif; }
.ex-ring-pct { font-size: 15px; font-weight: 700; }
.ex-ring-lbl { font-size: 9.5px; fill: var(--text-muted); font-weight: 600; font-family: 'Outfit', sans-serif; }

.ex-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ex-kpi { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.ex-kpi-l { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.ex-kpi-v { font-size: 1.35rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; line-height: 1.2; word-break: break-word; }
.ex-kpi-s { font-size: 0.72rem; color: var(--text-muted); }
.ex-kpi.is-bad { border-color: rgba(220, 38, 38, 0.35); background: #fef2f2; }
.ex-kpi.is-bad .ex-kpi-v { color: #dc2626; }

.ex-summary { background: linear-gradient(0deg, #fff, #fff) padding-box; border-left: 4px solid var(--primary-start); }
.ex-summary h3, .ex-sec-h h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.ex-summary p { font-size: 0.9rem; line-height: 1.6; color: var(--text-main); margin-top: 6px; max-width: 110ch; }
.ex-summary-alert { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ex-summary-alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.ex-summary-alert.lvl-critico { color: #dc2626; }
.ex-summary-alert.lvl-riesgo { color: #c2410c; }
.ex-summary-alert.lvl-atencion { color: #a16207; }
.ex-summary-alert.lvl-info { color: var(--text-muted); }

.ex-sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.ex-sec-h span { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.ex-sec-h.sub { margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.ex-sec-h h4 { font-size: 0.86rem; font-weight: 700; color: var(--text-main); }
.ex-grid-3 { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 16px; }
.ex-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ex-col { display: flex; flex-direction: column; gap: 16px; }

.ex-nodata { display: flex; gap: 10px; align-items: flex-start; font-size: 0.84rem; color: var(--text-muted); background: var(--ex-soft); border: 1px dashed var(--border-color); border-radius: 10px; padding: 14px 16px; line-height: 1.5; }
.ex-nodata svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.ex-nodata strong { color: var(--text-main); }

/* --- Línea de tiempo --- */
.ex-tl-scroll { overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.ex-tl { position: relative; padding-top: 2px; }
.ex-tl-years, .ex-tl-months { display: flex; }
.ex-tl-years div { font-size: 0.78rem; font-weight: 800; color: var(--primary-start); padding: 0 0 4px 6px; border-left: 2px solid var(--primary-start); }
.ex-tl-months div { flex: 1; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-align: center; padding: 6px 0; background: var(--ex-soft); border-right: 1px solid #fff; }
.ex-tl-months div:first-child { border-radius: 6px 0 0 6px; }
.ex-tl-months div:last-child { border-radius: 0 6px 6px 0; }
.ex-tl-lane { position: relative; height: 92px; margin-top: 8px; }
.ex-tl-lane .ex-tl-today { top: 0; bottom: -18px; z-index: 3; }
.ex-tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-color); }
.ex-tl-grid.is-year { width: 2px; background: #bfd0e3; }
.ex-tl-plan { position: absolute; top: 30px; height: 26px; background: repeating-linear-gradient(135deg, #dbe6f2 0 6px, #eaf1f8 6px 12px); border: 1px solid #b7cbe0; border-radius: 6px; }
.ex-tl-done { position: absolute; top: 30px; height: 26px; background: var(--primary-start); border-radius: 6px 0 0 6px; }
.ex-tl-over { position: absolute; top: 30px; height: 26px; background: repeating-linear-gradient(135deg, #dc2626 0 6px, #f87171 6px 12px); border-radius: 0 6px 6px 0; }
.ex-tl-orig { position: absolute; top: 24px; height: 38px; border-left: 2px dashed #7c3aed; }
.ex-tl-cap { position: absolute; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; line-height: 1.25; }
.ex-tl-cap b { display: block; color: var(--text-main); font-weight: 700; }
.ex-tl-cap.start { top: 60px; transform: translateX(0); }
.ex-tl-cap.end { top: 60px; transform: translateX(-100%); text-align: right; }
.ex-tl-cap.start, .ex-tl-cap.end { padding-top: 2px; }
.ex-tl-marks { position: relative; height: 14px; }
.ex-tl-ep, .ex-tl-mod { position: absolute; top: 2px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: #059669; border: 2px solid #fff; box-shadow: 0 0 0 1px #059669; }
.ex-tl-mod { background: #7c3aed; box-shadow: 0 0 0 1px #7c3aed; border-radius: 50%; transform: translateX(-50%); }
.ex-tl-today { position: absolute; width: 0; border-left: 2px solid var(--ex-ink); pointer-events: none; }
.ex-tl-today span { position: absolute; top: 2px; left: 6px; font-size: 0.68rem; font-weight: 800; color: #fff; background: var(--ex-ink); padding: 2px 7px; border-radius: 4px; white-space: nowrap; }

.ex-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 0.76rem; color: var(--text-muted); }
.ex-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ex-legend i { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.lg-done { background: var(--primary-start); }
.lg-plan { background: repeating-linear-gradient(135deg, #dbe6f2 0 4px, #eaf1f8 4px 8px); border: 1px solid #b7cbe0; }
.lg-over { background: #dc2626; }
.lg-orig { border-left: 2px dashed #7c3aed; width: 2px !important; border-radius: 0 !important; }
.lg-ep { width: 9px !important; height: 9px !important; background: #059669; transform: rotate(45deg); }
.lg-mod { width: 9px !important; height: 9px !important; background: #7c3aed; border-radius: 50% !important; }
.lg-prog { height: 0 !important; border-top: 2px dashed #6366f1; border-radius: 0 !important; }
.lg-fis { height: 3px !important; background: var(--primary-start); }
.lg-fin { height: 3px !important; background: #059669; }

/* --- Barras horizontales y contador --- */
.ex-hbar { margin-bottom: 14px; }
.ex-hbar-head { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.ex-hbar-head strong { color: var(--text-main); font-variant-numeric: tabular-nums; }
.ex-hbar-track { height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.ex-hbar-track.big { height: 16px; border-radius: 8px; margin: 10px 0 8px; }
.ex-hbar-fill { height: 100%; border-radius: inherit; transition: width 0.6s ease; }
.ex-dev { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--ex-soft); font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.ex-dev strong { font-size: 1.15rem; color: var(--text-main); }
.ex-dev.is-bad { background: #fef2f2; }
.ex-dev.is-good { background: #ecfdf5; }
.ex-counter { display: flex; flex-direction: column; height: 100%; justify-content: center; }
.ex-counter-t { font-size: 0.78rem; font-weight: 700; color: var(--primary-start); }
.ex-counter.is-over .ex-counter-t { color: #dc2626; }
.ex-counter strong { font-size: 2.1rem; font-weight: 800; color: var(--text-main); line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ex-counter strong small { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.ex-counter-s { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.ex-counter.is-over .ex-counter-s { color: #dc2626; }

.ex-proj-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.ex-proj-row:last-child { border-bottom: none; }
.ex-proj-row span { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.ex-proj-row strong { font-size: 0.98rem; font-weight: 800; color: var(--text-main); text-align: right; font-variant-numeric: tabular-nums; }
.ex-proj-row em { grid-column: 1 / -1; font-style: normal; font-size: 0.72rem; color: var(--text-muted); }
.ex-proj-row.is-est { background: var(--ex-soft); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }

/* --- Curva --- */
.ex-chart-wrap { width: 100%; overflow-x: auto; }
.ex-chart { width: 100%; min-width: 560px; height: auto; display: block; }
.ex-cg { stroke: #e2e8f0; stroke-width: 1; }
.ex-ct { font-size: 11px; fill: #64748b; font-family: 'Outfit', sans-serif; font-weight: 600; }
.ex-ct-y { font-weight: 800; fill: var(--primary-start); }
.ex-ct-today { fill: #0f172a; font-weight: 800; }
.ex-c-today { stroke: #0f172a; stroke-width: 1.5; }
.ex-c-end { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 4 3; }
.ex-c-prog { fill: none; stroke: #6366f1; stroke-width: 2; stroke-dasharray: 6 4; }
.ex-c-fis { fill: none; stroke: var(--primary-start); stroke-width: 3; stroke-linejoin: round; }
.ex-c-fin { fill: none; stroke: #059669; stroke-width: 2.2; stroke-linejoin: round; }
.ex-d-prog { fill: #fff; stroke: #6366f1; stroke-width: 1.6; }
.ex-d-fis { fill: var(--primary-start); stroke: #fff; stroke-width: 1.5; }
.ex-d-fin { fill: #059669; stroke: #fff; stroke-width: 1.5; }

/* --- Actividad mensual --- */
.ex-months { display: flex; flex-direction: column; gap: 6px; }
.ex-month { border: 1px solid var(--border-color); border-radius: 10px; background: #fff; }
.ex-month summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; cursor: pointer; font-size: 0.86rem; font-weight: 700; color: var(--text-main); list-style: none; }
.ex-month summary::-webkit-details-marker { display: none; }
.ex-month summary::before { content: "▸"; color: var(--text-muted); margin-right: 8px; transition: transform 0.2s; }
.ex-month[open] summary::before { transform: rotate(90deg); }
.ex-month summary span { flex: 1; }
.ex-month summary em { font-style: normal; font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.ex-month ul { list-style: none; padding: 0 14px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-month li { display: grid; grid-template-columns: 82px 112px 1fr; gap: 10px; align-items: baseline; font-size: 0.82rem; }
.ex-month time { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-month p { color: var(--text-main); line-height: 1.45; }
.ex-tag { font-size: 0.7rem; font-weight: 700; color: var(--primary-start); background: rgba(15, 76, 129, 0.07); padding: 2px 7px; border-radius: 5px; justify-self: start; }

/* --- Información contractual, plazos, financiero --- */
.ex-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.ex-info > div { padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.ex-plazos, .ex-fin { display: flex; flex-direction: column; gap: 10px; }
.ex-plazo-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: 0.8rem; }
.ex-fin-row { display: grid; grid-template-columns: 130px 1fr 200px; gap: 12px; align-items: center; font-size: 0.8rem; }
.ex-plazo-row { gap: 12px; align-items: center; font-size: 0.8rem; }
.ex-plazo-row span, .ex-fin-row span { color: var(--text-muted); font-weight: 600; }
.ex-plazo-row strong, .ex-fin-row strong { color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ex-plazo-track { height: 10px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.ex-plazo-track > div { height: 100%; border-radius: 5px; }
.ex-mods { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-color); padding-top: 14px; }
.ex-mods li { display: flex; gap: 10px; font-size: 0.8rem; }
.ex-mods .ex-mods-n { color: #fff; }
.ex-mods-n { width: 22px; height: 22px; border-radius: 50%; background: #7c3aed; color: #fff; font-weight: 800; font-size: 0.72rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ex-mods strong { display: block; color: var(--text-main); }
.ex-mods span { color: var(--text-muted); }

/* --- Estados de pago --- */
.ex-segbar { display: flex; height: 22px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.ex-seg { height: 100%; background: var(--c); border-right: 2px solid #fff; }
.ex-seg.is-pending { background: repeating-linear-gradient(135deg, var(--c) 0 5px, #fff 5px 8px); opacity: 0.7; }
.ex-segbar-lbl { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--text-muted); margin: 6px 0 14px; font-weight: 600; }
.ex-table-wrap { overflow-x: auto; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ex-table th { text-align: left; font-size: 0.72rem; color: var(--text-muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.ex-table td { padding: 9px 10px; border-bottom: 1px solid var(--border-color); color: var(--text-main); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-table .t-r { text-align: right; }
.ex-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.ex-ep-st { font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: #f1f5f9; color: var(--text-muted); }
.ex-ep-st.st-pagado { background: #ecfdf5; color: #047857; }
.ex-ep-st.st-entrmite, .ex-ep-st.st-presentado { background: #fefce8; color: #a16207; }
.ex-ep-st.st-rechazado { background: #fef2f2; color: #dc2626; }

/* --- Hitos --- */
.ex-milestones { list-style: none; padding: 0; margin: 0; position: relative; }
.ex-milestones li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.ex-milestones li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 36px; bottom: -8px; width: 2px; background: var(--border-color); }
.ex-ms-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #94a3b8; border: 2px solid #e2e8f0; position: relative; z-index: 1; }
.ex-ms-dot svg { width: 13px; height: 13px; }
.ms-cumplido .ex-ms-dot { background: #059669; border-color: #059669; color: #fff; }
.ms-vencido .ex-ms-dot { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.ex-ms-body strong { display: block; font-size: 0.84rem; color: var(--text-main); font-weight: 600; }
.ex-ms-body span { font-size: 0.74rem; color: var(--text-muted); }
.ex-ms-state { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.ms-cumplido .ex-ms-state { color: #059669; }
.ms-vencido .ex-ms-state { color: #dc2626; }

/* --- Alertas --- */
.ex-alerts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-alerts li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 0.84rem; line-height: 1.45; background: var(--ex-soft); color: var(--text-main); border-left: 4px solid #94a3b8; }
.ex-alerts svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.ex-alerts .lvl-critico { background: #fef2f2; border-color: #dc2626; }
.ex-alerts .lvl-critico svg { color: #dc2626; }
.ex-alerts .lvl-riesgo { background: #fff7ed; border-color: #ea580c; }
.ex-alerts .lvl-riesgo svg { color: #ea580c; }
.ex-alerts .lvl-atencion { background: #fefce8; border-color: #ca8a04; }
.ex-alerts .lvl-atencion svg { color: #ca8a04; }
.ex-alerts .lvl-ok { background: #ecfdf5; border-color: #059669; }
.ex-alerts .lvl-ok svg { color: #059669; }
.ex-alerts .lvl-info svg { color: #64748b; }

/* --- Fotos --- */
.ex-photo-month + .ex-photo-month { margin-top: 16px; }
.ex-photo-month h4 { font-size: 0.82rem; font-weight: 700; color: var(--primary-start); margin-bottom: 8px; }
.ex-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ex-photo { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: #fff; padding: 0; cursor: zoom-in; text-align: left; font-family: inherit; }
.ex-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ex-photo span { display: block; font-size: 0.72rem; color: var(--text-muted); font-weight: 600; padding: 6px 8px; }
.ex-lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.86); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ex-lightbox-inner { position: relative; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.ex-lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; }
.ex-lightbox-cap { color: #fff; padding-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.ex-lightbox-cap span { color: #cbd5e1; }
.ex-lightbox-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ex-lightbox-close svg { width: 18px; height: 18px; }

.ex-foot { font-size: 0.74rem; color: var(--text-muted); text-align: right; }

/* --- Editor (modal) --- */
.ex-modal { position: fixed; inset: 0; z-index: 5000; display: none; }
.ex-modal.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.ex-modal-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.ex-modal-card { position: relative; background: #fff; border-radius: 14px; width: min(980px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); }
.ex-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 22px 12px; }
.ex-modal-head h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-main); }
.ex-modal-head p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.ex-icon-btn { border: none; background: #f1f5f9; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ex-icon-btn svg { width: 16px; height: 16px; }
.ex-tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--border-color); overflow-x: auto; }
.ex-tab { border: none; background: none; font-family: inherit; font-size: 0.84rem; font-weight: 600; color: var(--text-muted); padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ex-tab.active { color: var(--primary-start); border-bottom-color: var(--primary-start); }
.ex-tab em { font-style: normal; font-size: 0.7rem; background: rgba(15, 76, 129, 0.1); color: var(--primary-start); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.ex-modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.ex-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-color); }
.ex-modal-foot .btn { display: inline-flex; align-items: center; gap: 7px; }
.ex-modal-foot .btn svg { width: 16px; height: 16px; }
.ex-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.ex-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ex-f span { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.ex-f input, .ex-f select { font-family: inherit; font-size: 0.86rem; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: var(--text-main); width: 100%; }
.ex-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ex-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) 36px; gap: 10px; align-items: end; padding: 12px; background: var(--ex-soft); border: 1px solid var(--border-color); border-radius: 10px; }
.ex-row .w2 { grid-column: span 2; }
.ex-row .w3 { grid-column: span 2; }
.ex-row-photo { grid-template-columns: 72px 140px 100px 1fr 36px; }
.ex-row-photo img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.ex-row-del { width: 36px; height: 36px; border: 1px solid rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.06); color: #ef4444; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ex-row-del svg { width: 15px; height: 15px; }
.ex-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border: 2px dashed #bfd0e3; border-radius: 12px; cursor: pointer; color: var(--primary-start); font-weight: 700; font-size: 0.86rem; margin-bottom: 14px; background: rgba(15, 76, 129, 0.03); }
.ex-drop small { color: var(--text-muted); font-weight: 500; font-size: 0.74rem; }
.ex-drop svg { width: 24px; height: 24px; }

/* --- Responsivo --- */
@media (max-width: 1280px) {
  .ex-grid-3 { grid-template-columns: 1fr 1fr; }
  .ex-grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .ex-card-figs { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .ex-grid-2 { grid-template-columns: 1fr; }
  .ex-head-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  #view-execution .card { padding: 16px; }
  .ex-kpis { grid-template-columns: repeat(2, 1fr); }
  .ex-grid-3 { grid-template-columns: 1fr; }
  .ex-head { grid-template-columns: 1fr; }
  .ex-head-ring { order: -1; display: flex; justify-content: center; }
  .ex-head h2 { font-size: 1.1rem; }
  .ex-mini { grid-template-columns: 1fr; gap: 6px; }
  .ex-mini-date:last-child { text-align: right; }
  .ex-card-top { flex-direction: column; gap: 8px; }
  .ex-info { grid-template-columns: 1fr; }
  .ex-plazo-row, .ex-fin-row { grid-template-columns: 1fr auto; }
  .ex-plazo-row .ex-plazo-track, .ex-fin-row .ex-plazo-track { grid-column: 1 / -1; grid-row: 2; }
  .ex-month li { grid-template-columns: 1fr; gap: 2px; }
  .ex-form-grid { grid-template-columns: 1fr; }
  .ex-row, .ex-row-photo { grid-template-columns: 1fr 1fr; }
  .ex-row .w2, .ex-row .w3 { grid-column: 1 / -1; }
  .ex-row-del { grid-column: 2; justify-self: end; }
  .ex-search input { width: 100%; }
  .ex-toolbar-right, .ex-dash-actions-r { width: 100%; }
}
@media (max-width: 480px) {
  .ex-card-figs { grid-template-columns: repeat(2, 1fr); }
  .ex-kpi-v { font-size: 1.15rem; }
}
@media print {
  .ex-dash-actions, .ex-toolbar-right, .ex-chips { display: none !important; }
}

/* ==========================================================================
   FASE 4 · Carta Gantt, garantías, multas y paralizaciones
   ========================================================================== */
.ex-seg-btns { display: inline-flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.ex-seg-btns button { border: none; background: #fff; font-family: inherit; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); padding: 6px 12px; cursor: pointer; }
.ex-seg-btns button + button { border-left: 1px solid var(--border-color); }
.ex-seg-btns button.active { background: var(--primary-start); color: #fff; }
.ex-seg-btns button:focus-visible { outline: 2px solid var(--primary-start); outline-offset: -2px; }

.gt-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 10px; -webkit-overflow-scrolling: touch; }
.gt { position: relative; min-width: calc(190px + var(--w)); }
.gt-row, .gt-today-wrap { display: flex; }
.gt-row { border-bottom: 1px solid #f1f5f9; }
.gt-row:last-of-type { border-bottom: none; }
.gt-lbl { position: sticky; left: 0; z-index: 4; flex: 0 0 170px; background: #fff; border-right: 1px solid var(--border-color); padding: 0 12px; display: flex; align-items: center; font-size: 0.76rem; font-weight: 700; color: var(--text-main); min-height: 40px; }
.gt-track { position: relative; flex: 0 0 var(--w); width: var(--w); min-height: 40px; margin: 0 10px; }
.gt-head .gt-lbl { min-height: 26px; background: #f8fafc; }
.gt-head .gt-track { display: flex; min-height: 26px; background: #f8fafc; }
.gt-years div { font-size: 0.72rem; font-weight: 800; color: var(--primary-start); padding: 5px 8px; border-left: 2px solid var(--primary-start); }
.gt-units div { flex: 1; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-align: center; padding: 5px 0; border-left: 1px solid var(--border-color); }
.gt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: #f1f5f9; }
.gt-row-key { background: rgba(15, 76, 129, 0.025); }
.gt-row-key .gt-lbl { background: #f9fbfd; color: var(--primary-start); }
.gt-bar { position: absolute; top: 11px; height: 18px; border-radius: 5px; display: flex; align-items: center; overflow: hidden; z-index: 1; }
.gt-bar span { font-size: 0.66rem; font-weight: 800; color: #fff; padding: 0 6px; white-space: nowrap; }
.gt-orig { background: #cbd5e1; } .gt-orig span { color: #334155; }
.gt-vig { background: #93b4d4; } .gt-vig span { color: #0f2f52; }
.gt-ext { background: repeating-linear-gradient(135deg, #2563eb 0 5px, #60a5fa 5px 10px); z-index: 2; }
.gt-time { background: #64748b; }
.gt-real { background: var(--primary-start); }
.gt-par { background: repeating-linear-gradient(135deg, #dc2626 0 5px, #fca5a5 5px 10px); }
.gt-none { position: absolute; top: 12px; left: 10px; font-size: 0.72rem; color: #94a3b8; font-style: italic; }
.gt-mark { position: absolute; top: 13px; width: 13px; height: 13px; transform: translateX(-50%) rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 1px currentColor; z-index: 3; cursor: help; }
.gt-mark b { position: absolute; left: 14px; top: -3px; transform: rotate(-45deg); transform-origin: left; font-size: 0.62rem; font-weight: 800; color: #1e293b; white-space: nowrap; }
.gt-m-ep { background: #059669; color: #059669; }
.gt-m-ep.is-pend { background: #ca8a04; color: #ca8a04; }
.gt-m-mod { background: #7c3aed; color: #7c3aed; border-radius: 50%; transform: translateX(-50%); }
.gt-m-mod b { transform: none; top: -1px; left: 15px; }
.gt-m-hito { background: var(--primary-start); color: var(--primary-start); }
.gt-m-hito.is-orig { background: #94a3b8; color: #94a3b8; }
.gt-m-hito.is-end { background: #0f172a; color: #0f172a; }
.gt-m-rec { background: #0d9488; color: #0d9488; }
.gt-today-wrap { position: absolute; inset: 0; pointer-events: none; }
.gt-today-wrap .gt-lbl { visibility: hidden; }
.gt-today-wrap .gt-track { min-height: 0; height: 100%; }
.gt-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid #0f172a; z-index: 5; }
.gt-today span { position: absolute; top: 4px; left: 4px; font-size: 0.62rem; font-weight: 800; color: #fff; background: #0f172a; padding: 1px 6px; border-radius: 4px; }
.lg-gt-orig { background: #cbd5e1; } .lg-gt-vig { background: #93b4d4; } .lg-gt-ext { background: repeating-linear-gradient(135deg, #2563eb 0 3px, #60a5fa 3px 6px); }
.lg-gt-time { background: #64748b; } .lg-gt-real { background: var(--primary-start); } .lg-gt-par { background: repeating-linear-gradient(135deg, #dc2626 0 3px, #fca5a5 3px 6px); }
.gt-read { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; line-height: 1.5; margin-top: 12px; padding: 10px 12px; border-radius: 8px; }
.gt-read svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.gt-read.is-late { background: #fff7ed; color: #9a3412; }
.gt-read.is-ok { background: #ecfdf5; color: #065f46; }

/* Garantías */
.ex-gar { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-gar li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 4px solid #94a3b8; border-radius: 8px; }
.ex-gar li strong { display: block; font-size: 0.84rem; color: var(--text-main); }
.ex-gar li span { font-size: 0.74rem; color: var(--text-muted); }
.ex-gar-r { text-align: right; }
.ex-gar-st { font-size: 0.7rem !important; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; }
.ex-gar li.is-ok { border-left-color: #059669; } .ex-gar li.is-ok .ex-gar-st { background: #ecfdf5; color: #047857; }
.ex-gar li.is-soon { border-left-color: #ca8a04; background: #fffdf5; } .ex-gar li.is-soon .ex-gar-st { background: #fefce8; color: #a16207; }
.ex-gar li.is-bad { border-left-color: #dc2626; background: #fffafa; } .ex-gar li.is-bad .ex-gar-st { background: #fef2f2; color: #dc2626; }

/* Paralizaciones y multas */
.ex-subh { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; color: var(--text-main); margin: 4px 0 8px; }
.ex-subh + .ex-mini-list, .ex-subh + p { margin-bottom: 14px; }
.ex-subh em { font-style: normal; font-weight: 800; color: var(--text-muted); }
.ex-mini-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.ex-mini-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; }
.ex-mini-list strong { display: block; color: var(--text-main); }
.ex-mini-list span { color: var(--text-muted); }
.ex-mini-tag { flex-shrink: 0; font-size: 0.68rem !important; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.ex-mini-tag.is-par { background: #fef2f2; color: #dc2626 !important; }
.ex-mini-tag.is-mul { background: #fff7ed; color: #c2410c !important; }
.ex-fin-row.is-sub span { padding-left: 12px; font-weight: 500; }
.ex-f-check { flex-direction: row !important; align-items: center; gap: 8px !important; align-self: end; padding-bottom: 8px; }
.ex-f-check input { width: 17px !important; height: 17px; accent-color: var(--primary-start); }
.ex-f-check span { font-size: 0.8rem !important; color: var(--text-main) !important; }
@media (max-width: 768px) {
  .gt-lbl { flex-basis: 118px; font-size: 0.7rem; padding: 0 8px; }
  .gt { min-width: calc(138px + var(--w)); }
  .ex-gar li { grid-template-columns: 1fr; gap: 4px; }
  .ex-gar-r { text-align: left; }
}

/* ==========================================================================
   GARANTÍAS Y PÓLIZAS
   ========================================================================== */
.ex-gar-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px !important; margin-bottom: 14px; border-left: 4px solid #b45309; }
.ex-gar-strip-h { display: flex; align-items: center; gap: 10px; }
.ex-gar-strip-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff7ed; color: #b45309; }
.ex-gar-strip-ico svg { width: 20px; height: 20px; }
.ex-gar-strip-h strong { display: block; font-size: 0.9rem; color: var(--text-main); }
.ex-gar-strip-h span { font-size: 0.74rem; color: var(--text-muted); }
.ex-gar-strip-k { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.ex-gar-strip-k span { font-size: 0.76rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.ex-gar-strip-k strong { font-weight: 800; }
.k-red { background: #fef2f2; color: #b91c1c; } .k-orange { background: #fff7ed; color: #c2410c; } .k-amber { background: #fefce8; color: #854d0e; }
.gar-head { padding: 18px 22px !important; border-top: 4px solid #b45309; margin-bottom: 14px; }
.gar-title { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.gar-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #fff7ed; color: #b45309; flex-shrink: 0; }
.gar-ico svg { width: 22px; height: 22px; }
.gar-title h2 { font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.gar-title p { font-size: 0.8rem; color: var(--text-muted); }
.gar-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.gar-kpis div { border: 1px solid var(--border-color); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 12px; }
.gar-kpis strong { display: block; font-size: 1.25rem; font-weight: 800; color: var(--text-main); word-break: break-word; }
.gar-kpis span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.gar-cal { padding: 16px 18px !important; margin-bottom: 14px; }
.gar-cal h3, .gar-list h3 { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }
.gar-cal h3 svg { width: 16px; height: 16px; color: #b45309; }
.gar-cal-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.gar-mes { border: 1px solid var(--border-color); border-radius: 10px; padding: 8px; background: #fafbfc; display: flex; flex-direction: column; gap: 5px; min-height: 110px; }
.gar-mes.is-venc { background: #fef2f2; border-color: #fecaca; }
.gar-mes.is-empty p { font-size: 0.72rem; color: #5f6b7d; text-align: center; margin: auto 0; }
.gar-mes-h { display: flex; justify-content: space-between; align-items: center; font-size: 0.74rem; text-transform: capitalize; padding-bottom: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 2px; }
.gar-mes-h strong { color: var(--text-main); }
.gar-mes-h span { font-weight: 800; color: var(--text-muted); background: #fff; border-radius: 6px; padding: 0 6px; }
.gar-chip { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; text-align: left; border: none; border-left: 3px solid var(--c); background: #fff; border-radius: 6px; padding: 5px 7px; font-family: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.gar-chip:hover { box-shadow: 0 3px 8px rgba(15, 23, 42, 0.1); }
.gar-chip strong { font-size: 0.72rem; color: color-mix(in srgb, var(--c) 70%, #000); grid-row: span 2; align-self: center; }
.gar-chip span { font-size: 0.7rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gar-chip em { font-style: normal; font-size: 0.64rem; color: var(--text-muted); }
.gar-list { padding: 16px 18px !important; }
.gar-tools { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.gar-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.gar-tab { border: 1px solid var(--border-color); background: #fff; border-radius: 999px; padding: 6px 12px; font-family: inherit; font-size: 0.78rem; font-weight: 600; color: var(--text-main); cursor: pointer; }
.gar-tab strong { color: var(--text-muted); font-weight: 800; margin-left: 2px; }
.gar-tab.active { background: #b45309; border-color: #b45309; color: #fff; }
.gar-tab.active strong { color: rgba(255, 255, 255, 0.85); }
.gar-sel { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gar-sel select { font-family: inherit; font-size: 0.8rem; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 8px; max-width: 260px; background: #fff; }
.gar-items { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.gar-item { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(200px, 0.9fr) auto; gap: 16px; align-items: center; border: 1px solid var(--border-color); border-left: 5px solid var(--c); border-radius: 12px; padding: 12px 14px; background: #fff; transition: box-shadow 0.2s; }
.gar-item.gar-vencida { background: #fffafa; }
.gar-item.gar-cerrada { opacity: 0.8; }
.gar-item.gar-flash { box-shadow: 0 0 0 3px var(--c); }
.gar-i-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gar-i-main > strong { font-size: 0.86rem; color: var(--text-main); }
.gar-i-sub { font-size: 0.74rem; color: var(--text-muted); }
.gar-st { align-self: flex-start; font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; color: color-mix(in srgb, var(--c) 70%, #000); background: color-mix(in srgb, var(--c) 12%, #fff); margin-bottom: 2px; }
.gar-sol { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 0.72rem; font-weight: 700; color: #4338ca; background: #eef2ff; padding: 2px 8px; border-radius: 6px; margin-top: 2px; }
.gar-sol svg { width: 12px; height: 12px; }
.gar-i-monto { display: flex; flex-direction: column; gap: 3px; }
.gar-i-monto strong { font-size: 1rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.gar-i-monto > span { font-size: 0.74rem; color: var(--text-muted); }
.gar-i-monto small { font-size: 0.68rem; color: var(--text-muted); }
.gar-vig { display: block; height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.gar-vig i { display: block; height: 100%; border-radius: 4px; }
.gar-i-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gar-i-acc button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-color); background: #fff; border-radius: 7px; font-family: inherit; font-size: 0.72rem; font-weight: 700; color: var(--text-main); padding: 5px 8px; cursor: pointer; white-space: nowrap; }
.gar-i-acc button svg { width: 13px; height: 13px; }
.gar-i-acc button:hover { border-color: #b45309; color: #b45309; }
.gar-i-acc .gar-cobrar:hover { border-color: #dc2626; color: #dc2626; }
.gar-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8rem; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.gar-warn svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 1200px) { .gar-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gar-item { grid-template-columns: 1fr 1fr; } .gar-i-acc { grid-column: 1 / -1; grid-template-columns: repeat(5, auto); justify-content: start; } }
@media (max-width: 768px) { .gar-kpis { grid-template-columns: 1fr 1fr; } .gar-item { grid-template-columns: 1fr; } .gar-i-acc { grid-template-columns: 1fr 1fr; } .gar-sel select { max-width: 100%; width: 100%; } }
.gar-head { margin-top: 14px; }


/* ==========================================================================
   FINANCIAMIENTO DEL CONTRATO (M$): disponible − contratación = saldo por comprometer
   ========================================================================== */
.ex-finan { padding: 16px 18px !important; border-left: 4px solid #0e7490; }
.ex-finan-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ex-finan-h h3 { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.ex-finan-h h3 svg { width: 17px; height: 17px; color: #0e7490; }
.ex-finan-h h3 small { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }
.ex-finan-pct { font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #334155; }
.ex-finan-pct.is-def { background: #fef2f2; color: #b91c1c; }
.ex-finan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.ex-finan-op { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; color: #94a3b8; }
.ex-finan-t { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; background: #fff; min-width: 0; }
.ex-finan-t span { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.ex-finan-t strong { font-size: 1.35rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ex-finan-t em { font-style: normal; font-size: 0.72rem; color: var(--text-muted); line-height: 1.35; }
.ex-finan-t.is-ok { background: #f0fdf4; border-color: #bbf7d0; } .ex-finan-t.is-ok strong { color: #047857; }
.ex-finan-t.is-def { background: #fef2f2; border-color: #fecaca; } .ex-finan-t.is-def strong { color: #b91c1c; }
.ex-finan-bar { position: relative; display: flex; height: 12px; margin: 14px 0 4px; background: #e2e8f0; border-radius: 6px; overflow: hidden; }
.ex-finan-bar i { display: block; height: 100%; background: var(--primary-start); }
.ex-finan-bar b { position: absolute; right: 0; top: 0; height: 100%; background: repeating-linear-gradient(45deg, #dc2626 0 6px, #f87171 6px 12px); }
.ex-finan .ex-help { margin: 8px 0 0; font-size: 0.74rem; }
.ex-card-fin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-color); }
.ex-card-fin div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-card-fin span { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.ex-card-fin strong { font-size: 0.9rem; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; }
.ex-card-fin .is-ok strong { color: #047857; } .ex-card-fin .is-def strong { color: #b91c1c; }
.ex-fin-tot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 18px !important; margin-bottom: 12px; }
.ex-fin-tot div { display: flex; flex-direction: column; gap: 2px; }
.ex-fin-tot span { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.ex-fin-tot strong { font-size: 1.2rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.ex-fin-tot .is-ok strong { color: #047857; } .ex-fin-tot .is-def strong { color: #b91c1c; }
.ex-fin-tot p { grid-column: 1 / -1; font-size: 0.74rem; color: var(--text-muted); margin: 0; }
@media (max-width: 900px) {
  .ex-finan-grid { grid-template-columns: 1fr; } .ex-finan-op { display: none; }
  .ex-fin-tot, .ex-card-fin { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 520px) { .ex-fin-tot { grid-template-columns: 1fr; } .ex-card-fin { grid-template-columns: 1fr 1fr; } }

/* Editor: financiamiento del contrato con cálculo en vivo (M$) */
.ex-prefill { display: flex; align-items: flex-start; gap: 8px; font-size: 0.78rem; color: #1e3a8a; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; }
.ex-prefill svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.ex-fin-edit { border: 1px solid #a5f3fc; background: #f0fdff; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.ex-fin-edit h4, .ex-ed-h { font-size: 0.86rem; font-weight: 800; color: var(--text-main); margin: 0 0 10px; }
.ex-fin-edit h4 small { font-weight: 600; color: var(--text-muted); }
.ex-fin-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ex-fin-edit-grid .ex-f small { font-size: 0.7rem; color: var(--text-muted); line-height: 1.35; }
.ex-live { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--border-color); border-radius: 10px; padding: 9px 12px; }
.ex-live span { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
.ex-live strong { font-size: 1.1rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.ex-live small { font-size: 0.68rem; color: var(--text-muted); }
.ex-live-saldo { grid-column: 1 / -1; }
.ex-live-saldo.is-ok { background: #f0fdf4; border-color: #bbf7d0; } .ex-live-saldo.is-ok strong { color: #047857; }
.ex-live-saldo.is-def { background: #fef2f2; border-color: #fecaca; } .ex-live-saldo.is-def strong { color: #b91c1c; }
@media (max-width: 640px) { .ex-fin-edit-grid { grid-template-columns: 1fr; } }