/* ============================================================
   INFORME DE DIRECTORIO — formato PRESUPUESTO_2026-2027.md
   Mismas tablas y misma jerarquía visual del documento.
   ============================================================ */

.rep-dialog .export-dialog-shell { max-width:1040px;width:96vw }
.rep-layout { display:flex;gap:16px;min-height:0 }
.rep-side { flex:0 0 190px;border-right:1px solid var(--line);padding-right:14px;overflow-y:auto;max-height:62vh }
.rep-side h4 { font:600 9px Manrope;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;margin:0 0 8px }
.rep-side label { display:flex;gap:8px;align-items:flex-start;padding:6px 4px;cursor:pointer;font:400 10.5px/1.4 Manrope;color:var(--ink);border-radius:6px }
.rep-side label:hover { background:var(--soft) }
.rep-side input { accent-color:var(--forest-2);margin-top:1px;flex-shrink:0 }
.rep-prev-wrap { flex:1;min-width:0;display:flex;flex-direction:column }
.rep-prev { flex:1;overflow-y:auto;max-height:58vh;background:#fff;border:1px solid var(--line);border-radius:10px;padding:26px 30px }
.rep-prev .doc[contenteditable="true"] { outline:2px dashed var(--gold);outline-offset:6px;border-radius:6px;cursor:text }

.rep-edit-bar { display:flex;align-items:center;gap:10px;margin-bottom:8px;flex-wrap:wrap }
.rep-edit-note { font:400 10px Manrope;color:var(--muted) }
.rep-edit-note .text-button { font:600 10px Manrope;color:var(--forest-2);text-decoration:underline;background:none;border:none;cursor:pointer;padding:0 }

.rep-hint { font:400 9px/1.5 Manrope;color:var(--muted);margin:2px 0 8px }

.rep-drop {
  display:flex;align-items:center;justify-content:center;gap:6px;padding:10px 8px;margin-bottom:8px;
  border:1.5px dashed var(--line);border-radius:9px;cursor:pointer;font:600 10.5px Manrope;color:var(--forest-2);
  text-align:center;transition:border-color .15s,background .15s;
}
.rep-drop:hover, .rep-drop.over { border-color:var(--forest-2);background:rgba(27,104,64,.05) }

.rep-attach-list { display:flex;flex-direction:column;gap:6px }
.rep-attach-item { display:flex;align-items:center;gap:7px;padding:5px 6px;border:1px solid var(--line);border-radius:8px;background:var(--card) }
.rai-thumb { width:26px;height:26px;object-fit:cover;border-radius:5px;flex-shrink:0 }
.rai-icon { font-size:15px;flex-shrink:0;width:26px;text-align:center }
.rai-info { flex:1;min-width:0;display:flex;flex-direction:column }
.rai-name { font:600 9.5px Manrope;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap }
.rai-info small { font:400 8.5px Manrope;color:var(--muted) }
.rai-del { background:none;border:none;cursor:pointer;color:var(--muted);font-size:12px;padding:2px 4px;flex-shrink:0 }
.rai-del:hover { color:var(--red) }

/* ---------- Anexos dentro del documento ---------- */
.doc .anexo-img { margin:0 0 16px;text-align:center }
.doc .anexo-img img { max-width:100%;max-height:520px;border:1px solid #deeadf;border-radius:8px }
.doc .anexo-img figcaption { font:400 9px Manrope;color:#688076;margin-top:4px }
.doc .anexo-files { display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px }
.doc .anexo-file {
  display:flex;align-items:center;gap:6px;padding:7px 11px;border:1px solid #deeadf;border-radius:9px;
  background:#fafcf9;font:600 10px Manrope;color:#173d2a;text-decoration:none;
}
.doc .anexo-file small { color:#688076;font-weight:400;margin-left:2px }

/* ---------- Documento ---------- */
.doc { font-family:Manrope,system-ui,sans-serif;color:#173d2a;font-size:11px;line-height:1.6 }
.doc h1 {
  font:700 23px/1.25 'Playfair Display',Georgia,serif;color:#0c4324;margin:0 0 2px;
}
.doc .doc-org { font:700 12px Manrope;color:#1b6840;margin:0 }
.doc .doc-dep { font:400 10.5px Manrope;color:#688076;font-style:italic;margin:1px 0 0 }
.doc hr { border:none;border-top:1px solid #deeadf;margin:20px 0 }
.doc h2 {
  font:700 15px 'Playfair Display',Georgia,serif;color:#0c4324;margin:24px 0 10px;
  padding-bottom:6px;border-bottom:2px solid #0c4324;
}
.doc h3 { font:700 12px Manrope;color:#1b6840;margin:18px 0 8px }
.doc ul { margin:8px 0;padding-left:18px }
.doc li { margin-bottom:3px }
.doc li strong { color:#0c4324 }
.doc blockquote {
  margin:14px 0;padding:11px 15px;border-left:3px solid #c4a46b;background:#faf7f0;
  font:400 10px/1.65 Manrope;color:#688076;border-radius:0 8px 8px 0;
}
.doc blockquote strong { color:#173d2a }
.doc .doc-foot { margin-top:26px;padding-top:14px;border-top:1px solid #deeadf;text-align:center;font:400 9.5px Manrope;color:#688076;font-style:italic }
.doc .doc-total-line { font:700 12px Manrope;color:#0c4324;margin:10px 0 }

/* ---------- Tablas del documento ---------- */
.doc table { width:100%;border-collapse:collapse;margin:10px 0 16px;font-size:10.5px }
.doc thead th {
  background:#0c4324;color:#fff;font:700 9px Manrope;text-transform:uppercase;letter-spacing:.4px;
  padding:8px 9px;text-align:left;border:none;
}
.doc thead th.num { text-align:right }
.doc tbody td { padding:6px 9px;border-bottom:1px solid #edf5eb;vertical-align:top }
.doc tbody td.num { text-align:right;font-family:'DM Mono',ui-monospace,monospace;font-variant-numeric:tabular-nums }
.doc tbody tr:nth-child(even) td { background:#fafcf9 }
.doc tbody tr:hover td { background:#f2f8f1 }

/* Encabezado de bloque dentro de una misma tabla (Mano de Obra Campo, Costos y
   Gastos de Producción, Gastos ADM…), como los renglones grises del documento */
.doc tr.sec td {
  background:#f2f8f1 !important;font-weight:700;color:#0c4324;text-transform:uppercase;
  letter-spacing:.4px;font-size:9px;border-top:1px solid #cfe0cf;border-bottom:1px solid #cfe0cf;
  padding-top:7px;padding-bottom:7px;
}

/* Filas de subtotal y total, como los renglones en negrita del documento */
.doc tr.sub td { background:#edf5eb !important;font-weight:700;color:#0c4324;border-bottom:1px solid #cfe0cf }
.doc tr.tot td {
  background:#0c4324 !important;color:#fff;font-weight:700;font-size:11px;
  border-bottom:none;border-top:2px solid #0c4324;
}
.doc tr.tot td.num { color:#fff }

/* Variaciones: baja de costo en verde, alza en rojo */
.doc .v-baja { color:#1b6840;font-weight:700 }
.doc .v-alza { color:#bb3e49;font-weight:700 }
.doc .v-neutra { color:#688076 }
.doc tr.tot .v-baja { color:#a8e6c0 }
.doc tr.tot .v-alza { color:#ffc9ce }
.doc tr.tot .v-neutra { color:#cfe0cf }

.doc .doc-vacio {
  padding:16px;border:1px dashed #deeadf;border-radius:8px;background:#fafcf9;
  font:400 10px/1.6 Manrope;color:#688076;text-align:center;
}
.doc .doc-vacio b { color:#173d2a }

.rep-actions { display:flex;justify-content:space-between;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);flex-wrap:wrap }
.rep-actions .rep-grp { display:flex;gap:8px;flex-wrap:wrap }

/* ---------- Impresión ---------- */
@media print {
  body > *:not(#repPrintHost) { display:none !important }
  #repPrintHost { display:block !important;position:static !important }
  #repPrintHost .doc { font-size:9.5pt;color:#000 }
  #repPrintHost .doc h1 { font-size:19pt }
  #repPrintHost .doc h2 { font-size:12.5pt;page-break-after:avoid }
  #repPrintHost .doc h3 { font-size:11pt;page-break-after:avoid }
  #repPrintHost .doc table { page-break-inside:auto;font-size:8.5pt }
  #repPrintHost .doc tr { page-break-inside:avoid }
  #repPrintHost .doc thead { display:table-header-group }
  #repPrintHost .doc thead th { background:#0c4324 !important;color:#fff !important;-webkit-print-color-adjust:exact;print-color-adjust:exact }
  #repPrintHost .doc tr.tot td { background:#0c4324 !important;color:#fff !important;-webkit-print-color-adjust:exact;print-color-adjust:exact }
  #repPrintHost .doc tr.sub td { background:#edf5eb !important;-webkit-print-color-adjust:exact;print-color-adjust:exact }
  @page { margin:15mm 12mm }
}
#repPrintHost { display:none }

@media(max-width:820px){
  .rep-layout { flex-direction:column }
  .rep-side { flex:none;border-right:none;border-bottom:1px solid var(--line);padding:0 0 10px;max-height:150px }
  .rep-prev { padding:18px 16px }
}
