/* Bosque v9 · Reportes, biblioteca de guiones, categorías, panel plegable y modo oscuro. */
.side-fold{display:inline-flex;align-items:center;gap:7px;padding:3px 0;border:0;background:transparent;color:var(--ink);font:700 16px Georgia,Cambria,serif;text-align:left}
.fold-caret{display:inline-block;color:var(--muted);font:13px system-ui;transition:transform .2s ease}
.side-section.is-folded .fold-caret{transform:rotate(-90deg)}
.side-section.is-folded .chip-list,.side-section.is-folded .pending-list{display:none}
.side-section.is-folded .section-head{margin-bottom:0}
.side-section.is-folded #pendingCount{opacity:.7}
.report-panel,.docs-panel{padding:22px;min-height:375px}
.report-intro{display:flex;gap:15px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:18px}
.report-intro h3{font-size:24px;margin-bottom:5px}
.report-intro p{font-size:12px;line-height:1.5;color:var(--muted);margin:0;max-width:650px}
.report-actions{display:flex;gap:7px;flex-wrap:wrap}
.report-filters{display:grid;grid-template-columns:minmax(170px,2fr) repeat(4,minmax(120px,1fr)) auto;gap:8px;align-items:end;margin-bottom:14px}
.report-filters label{min-width:0;display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:750;color:var(--muted)}
.report-filters input,.report-filters select{width:100%;min-width:0;padding:8px;border:1px solid var(--edge);border-radius:10px;background:var(--cream);color:var(--ink)}
.report-filters .report-check{display:flex;flex-direction:row;align-items:center;gap:7px;margin-bottom:9px;white-space:nowrap}
.report-check input{width:auto}
.report-counter{font-size:11px;font-weight:800;color:var(--forest);margin:12px 0 7px}
.report-table-wrap{width:100%;overflow-x:auto;border:1px solid var(--edge);border-radius:13px;background:var(--cream)}
.report-table{width:100%;border-collapse:collapse;font-size:12px;min-width:900px}
.report-table th{text-align:left;padding:12px 10px;background:var(--sage);border-bottom:1px solid var(--edge);color:var(--ink);white-space:nowrap}
.report-table td{padding:10px;border-bottom:1px solid var(--edge);vertical-align:middle;color:var(--ink)}
.report-table tbody tr:last-child td{border-bottom:0}
.report-table tbody tr:hover{background:var(--sage)}
.report-table small{display:block;font-size:10px;margin-top:4px}
.report-task-link{padding:0;border:0;background:transparent;color:var(--forest-dark);font-size:12px;font-weight:750;text-align:left;text-decoration:underline;text-underline-offset:3px}
.report-status{min-width:118px;padding:6px;background:var(--cream);border:1px solid var(--edge);border-radius:7px;color:var(--ink);font-size:11px}
.category-tag{display:inline-block;background:var(--sage);color:var(--forest-dark);border:1px solid var(--edge);padding:4px 8px;border-radius:8px;font-weight:700;white-space:nowrap}
.report-group{margin-top:24px}.report-group>h3{font-size:16px;margin:0 0 9px}.report-group h3 small{color:var(--muted)}
.category-list{display:flex;flex-direction:column;gap:6px;margin:12px 0 19px;max-height:290px;overflow:auto}
.category-option{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--edge);background:var(--paper);border-radius:9px;font-size:13px}
.category-option .btn{padding:5px 8px;font-size:10px}
.document-checks{display:grid;gap:6px;max-height:190px;overflow:auto;margin-bottom:12px}
.document-checks label{display:flex;align-items:center;gap:7px;font-size:12px;padding:7px 9px;background:var(--paper);border:1px solid var(--edge);border-radius:9px;cursor:pointer;overflow-wrap:anywhere}
.document-checks input{accent-color:var(--forest)}
.linked-documents{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.doc-linked{max-width:100%;overflow-wrap:anywhere}
.docs-panel .doc-form{padding:17px;background:var(--paper);border:1px solid var(--edge);border-radius:14px;margin-bottom:20px}
.docs-panel .doc-form h4{margin:0 0 11px;font-size:16px}
.docs-panel .doc-form button{margin-top:7px}
#docUploadStatus{font-size:12px;color:var(--muted);margin-left:12px}
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.doc-tile{padding:16px;border:1px solid var(--edge);background:var(--cream);border-radius:14px;display:flex;flex-direction:column;gap:10px;min-width:0}
.doc-symbol{font-size:24px}.doc-body strong{display:block;font-size:13px;overflow-wrap:anywhere}
.doc-body small{display:block;font-size:11px;color:var(--muted);margin-top:5px;overflow-wrap:anywhere}
.doc-actions{margin-top:auto;display:flex;flex-wrap:wrap;gap:7px}.doc-actions .btn{font-size:11px}
/* Contraste específico para el árbol y las vistas antiguas de estilo claro. */
:root[data-theme="dark"] .tree-intro,:root[data-theme="dark"] .tree-group,:root[data-theme="dark"] .forest-project,
:root[data-theme="dark"] .forest-deliverable,:root[data-theme="dark"] .tree-task,
:root[data-theme="dark"] .tree-session,:root[data-theme="dark"] .notion-source,
:root[data-theme="dark"] .project-stats,:root[data-theme="dark"] .flow-pills span,
:root[data-theme="dark"] .number-pill,:root[data-theme="dark"] .capacity-summary div,
:root[data-theme="dark"] .project-deliverables .deliverable {background:#263b32!important;color:var(--ink)!important;border-color:#486653!important}
:root[data-theme="dark"] .tree-group{background:#21332b!important;border:2px dashed #56735b!important}
:root[data-theme="dark"] .forest-project{background:#2a4135!important}
:root[data-theme="dark"] .forest-deliverable{background:#1d3028!important;border-left-color:#8eae8b!important}
:root[data-theme="dark"] .tree-task{background:#31473a!important;border-color:#56735b!important}
:root[data-theme="dark"] .tree-task-title,:root[data-theme="dark"] .tree-group h4,
:root[data-theme="dark"] .tree-project-title,:root[data-theme="dark"] .tree-meta,
:root[data-theme="dark"] .tree-hours,:root[data-theme="dark"] .tree-session-label,
:root[data-theme="dark"] .forest-project-head strong,
:root[data-theme="dark"] .forest-deliverable-head,
:root[data-theme="dark"] .tree-intro p {color:var(--ink)!important}
:root[data-theme="dark"] .tree-session{background:#395443!important}
:root[data-theme="dark"] .tree-task::before{color:#abca9d}
:root[data-theme="dark"] .tree-task.drop-active,:root[data-theme="dark"] .forest-project.drop-active,
:root[data-theme="dark"] .forest-deliverable.drop-active,
:root[data-theme="dark"] .tree-group.drop-active{background:#476b50!important;outline:2px solid #b2d3a6}
:root[data-theme="dark"] .tree-progress,:root[data-theme="dark"] .capacity-meter{background:#465d4e}
:root[data-theme="dark"] .tree-progress span{background:#b2d3a6}
:root[data-theme="dark"] .tree-group-head{border-color:var(--edge)}
:root[data-theme="dark"] .report-task-link{color:#c9e9bc}
:root[data-theme="dark"] .category-tag{color:#e1f1d9}
:root[data-theme="dark"] .report-table tr:hover{background:#304d3a}
:root[data-theme="dark"] .notice{background:#2e4737;color:#e4f0e1;border-color:#507358}
:root[data-theme="dark"] .notice a,:root[data-theme="dark"] .notion-source a{color:#b9dfb3}
:root[data-theme="dark"] .kanban-card-meta,:root[data-theme="dark"] .kanban-client{color:var(--muted)}
:root[data-theme="dark"] .priority{background:#415746;color:var(--ink)}
:root[data-theme="dark"] .priority.high{background:#65533a;color:#ffdda3}
:root[data-theme="dark"] .priority.urgent{background:#643b39;color:#ffc4ad}
:root[data-theme="dark"] .priority.low{background:#2e4b58;color:#c5e4fa}
:root[data-theme="dark"] .project-card .btn,:root[data-theme="dark"] .report-table select{color:var(--ink)}
@media(max-width:1150px){.report-filters{grid-template-columns:repeat(3,minmax(150px,1fr))}}
@media(max-width:760px){.report-panel,.docs-panel{padding:12px}.report-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.report-filters label:first-child{grid-column:1/-1}.doc-grid{grid-template-columns:1fr}}
/* Un encabezado visible y primera columna fija para consultar reportes extensos. */
.report-table th{position:sticky;top:0;z-index:2}
.report-table th:first-child,.report-table td:first-child{position:sticky;left:0;z-index:1;background:var(--cream);min-width:185px}
.report-table th:first-child{background:var(--sage);z-index:3}
:root[data-theme="dark"] .report-table td:first-child{background:#202d29}
:root[data-theme="dark"] .report-table th:first-child{background:#324e3d}

/* Bosque v9.3 — Guion textual por tarea, sin importación de Word/JSON. */
.script-field{display:block;border:1px solid var(--edge);border-radius:14px;padding:13px;background:var(--paper)}
.script-field > span{font-size:15px;color:var(--forest-dark);margin-bottom:7px}
.script-field .helper{display:block;margin:0 0 10px;line-height:1.5}
.script-field textarea{min-height:240px;line-height:1.55;white-space:pre-wrap;font-size:13px;font-family:inherit;background:var(--cream);border-color:var(--edge);color:var(--ink)}
.script-readonly{margin:13px 0;padding:12px 14px;background:var(--paper);border:1px solid var(--edge);border-radius:12px}
.script-readonly h4{margin:0 0 10px;font-size:15px;color:var(--forest-dark)}
.script-readonly pre,.task-note-readonly{max-height:340px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;font-family:inherit;font-size:13px;color:var(--ink);background:var(--cream);padding:12px;border:1px solid var(--edge);border-radius:10px}
:root[data-theme="dark"] .script-field,:root[data-theme="dark"] .script-readonly{background:#263b32;border-color:#486653}
:root[data-theme="dark"] .script-field > span,:root[data-theme="dark"] .script-readonly h4{color:#c9e9bc}

/* v9.4: importación de guiones Word (solo revisión en navegador) */
#wordInput[hidden],#importWord[hidden]{display:none!important}
.overlay .modal:has(.word-import-preview){width:min(1040px,100%);max-height:94vh}
.word-import-preview .notice{margin-bottom:13px}
.word-import-preview .notice p{font-size:12px;margin:7px 0 0}
.word-warn{display:block;color:var(--danger,#aa522f)}
.word-import-settings,.word-owner-grid,.word-entry-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.word-owner-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.word-import-settings .field,.word-owner-grid .field,.word-entry-fields .field{min-width:0}
.word-import-settings select,.word-import-settings input,.word-owner-grid select,.word-entry-fields input,.word-entry-fields select{width:100%;min-width:0}
.word-section-title{font-size:15px;margin:18px 0 8px;color:var(--ink)}
.word-preview-header{display:flex;justify-content:space-between;gap:8px;align-items:center;flex-wrap:wrap;margin:20px 0 9px;color:var(--ink)}
#wordSelectedCount{color:var(--forest-dark);font-size:12px;font-weight:800}
.word-entries{max-height:42vh;overflow-y:auto;border:1px solid var(--edge);border-radius:13px;background:var(--cream)}
.word-entry{border-bottom:1px solid var(--edge)}
.word-entry:last-child{border-bottom:0}
.word-entry>summary{list-style:none;cursor:pointer;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;font-size:12px;line-height:1.4;color:var(--ink)}
.word-entry>summary::-webkit-details-marker{display:none}
.word-entry>summary::before{content:'›';font-weight:900;font-size:18px;color:var(--muted)}
.word-entry[open]>summary::before{content:'⌄'}
.word-entry>summary:hover{background:var(--sage)}
.word-entry>summary strong{flex:1 1 230px;overflow-wrap:anywhere}
.word-entry>summary small{color:var(--muted)}
.word-date{color:var(--forest-dark);font-weight:800}
.word-tag{display:inline-block;padding:3px 7px;border:1px solid var(--edge);background:var(--paper);border-radius:7px;font-size:11px;font-weight:750}
.word-match{padding:3px 8px;border-radius:9px;color:#17643c;background:#d8f1df;font-size:11px;white-space:nowrap}
.word-match.matched{background:#f8e7c7;color:#654815}
.word-entry-body{padding:13px;border-top:1px solid var(--edge);background:var(--paper);display:grid;gap:8px}
.word-entry-title{grid-column:1/-1}
.word-text{border:1px solid var(--edge);border-radius:9px;padding:9px 11px}
.word-text summary{cursor:pointer;font-size:12px;color:var(--forest-dark);font-weight:750}
.word-text pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.65 system-ui,sans-serif;color:var(--ink);max-height:300px;overflow:auto;margin:11px 0 0}
:root[data-theme="dark"] .word-match{background:#294d39;color:#beeacf}
:root[data-theme="dark"] .word-match.matched{background:#63512e;color:#f5dba1}
:root[data-theme="dark"] .word-entry-body{background:#263b32}
:root[data-theme="dark"] .word-text summary{color:#c9e9bc}
@media(max-width:700px){.word-entries{max-height:46vh}.word-entry>summary strong{flex-basis:130px}.word-import-settings,.word-owner-grid{grid-template-columns:1fr}}
