/* Expedientes · explorador Cliente › Expediente › Carpetas (case-folders.mjs). */
.cf-explorer, .cf-classic-back { display: none; }
body.cf-explorer-on .cf-explorer { display: block; margin-top: 22px; font-family: Manrope, Arial, sans-serif; color: #17231f; }
body.cf-explorer-on section.case-section { display: none; }
body.cf-classic-on .cf-classic-back { display: block; margin: 18px 0 0; }
.cf-classic-back button, .cf-classic-link button { border: 0; padding: 0; background: none; color: #1c6a57; font: 600 12px Manrope, Arial, sans-serif; text-decoration: underline; cursor: pointer; }
.cf-frame { position: relative; display: flex; height: max(600px, calc(100dvh - 120px)); overflow: hidden; border: 1px solid #dfe6e2; border-radius: 16px; background: #fbfcfa; }
.cf-frame.is-busy .cf-main { opacity: .6; pointer-events: none; }
.cf-loading { margin: 30px 0; color: #56665f; font-size: 13px; }
.cf-eyebrow { margin: 0 0 3px; color: #1c6a57; font: 500 10px "DM Mono", Manrope, monospace; letter-spacing: .06em; text-transform: uppercase; }
.cf-tree { flex: 0 0 330px; overflow: auto; padding: 16px 10px 20px; border-right: 1px solid #dfe6e2; background: #f4f7f5; }
.cf-tree-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 6px 10px; }
.cf-tree-head .cf-eyebrow { margin: 0; }
.cf-tree-head button { border: 1px solid #cbd6d1; border-radius: 8px; padding: 6px 10px; background: #fff; color: #245d49; font-size: 12px; font-weight: 600; }
.cf-classic-link { margin: 18px 8px 0; }
.cf-main { flex: 1; min-width: 0; overflow: auto; padding: 28px 36px 50px; }
.cf-row.cf-level0 { margin-top: 8px; }
.cf-row.cf-level0 > button:not(.cf-chev) { font-size: 14px; font-weight: 700; }
.cf-row.cf-level1 > button:not(.cf-chev) { font-weight: 700; }
.cf-explorer button.cf-inuse { border-color: #b9d6c8; background: #e6f1eb; color: #1c6a57; }

.cf-explorer button { font-family: inherit; cursor: pointer; }
.cf-explorer button:disabled { cursor: default; }
.cf-explorer button:focus-visible, .cf-explorer input:focus-visible { outline: 2px solid #a58a4e; outline-offset: 2px; }
.cf-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.cf-row.is-on { background: #d6e8df; }
.cf-row > button:not(.cf-chev) { flex: 1; min-width: 0; display: grid; gap: 1px; border: 0; padding: 7px 6px; background: none; color: #25433a; font-size: 13px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.cf-row.is-on > button:not(.cf-chev) { color: #123a2f; font-weight: 700; }
.cf-row.is-off > button:not(.cf-chev) { color: #8a9a92; font-weight: 500; }
.cf-row small { color: #6c7d74; font: 400 10px "DM Mono", Manrope, monospace; }
.cf-root > button:not(.cf-chev) { font-size: 14px; font-weight: 700; }
.cf-chev { flex: 0 0 24px; width: 24px; height: 30px; border: 0; padding: 0; background: none; color: #6c7d74; }
.cf-chev svg { transition: transform .12s; }
.cf-chev svg.is-open { transform: rotate(90deg); }
.cf-row.cf-d1 { margin-left: 22px; }
.cf-row.cf-d2 { margin-left: 44px; }
.cf-row.cf-d3 { margin-left: 66px; }
.cf-row.cf-d4 { margin-left: 88px; }
.cf-row.cf-d5 { margin-left: 110px; }
.cf-row.cf-d6 { margin-left: 132px; }
.cf-row.cf-d7 { margin-left: 154px; }
.cf-row.cf-d8 { margin-left: 176px; }
.cf-row.cf-d9 { margin-left: 198px; }
.cf-row.cf-d10 { margin-left: 220px; }
.cf-row.cf-d11 { margin-left: 242px; }
.cf-row.cf-d12 { margin-left: 264px; }
.cf-tree .cf-row:not(.cf-d0), .cf-pick-list .cf-row:not(.cf-d0) { position: relative; }
.cf-tree .cf-row:not(.cf-d0)::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; border-left: 1px solid #cfdad4; }


.cf-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 4px 0; }
.cf-title h2 { margin: 0; font-size: 30px; letter-spacing: -1px; line-height: 1.15; overflow-wrap: anywhere; }
.cf-meta { margin: 0 0 18px; color: #56665f; font-size: 13px; }
.cf-actions, .cf-doc-actions, .cf-box-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cf-actions button, .cf-doc-actions button, .cf-box-actions button { border: 1px solid #cbd6d1; border-radius: 8px; padding: 7px 11px; background: #fff; color: #245d49; font-size: 12px; font-weight: 600; }
.cf-doc-actions button { padding: 6px 10px; font-size: 11px; }
.cf-explorer button.cf-primary { border-color: #245d49; background: #245d49; color: #fff; }
.cf-explorer button.cf-primary:disabled { border-color: #cbd6d1; background: #eef2ef; color: #6c7d74; }
.cf-explorer button.cf-danger { border-color: #e3c2bb; color: #9a3b2a; }
.cf-explorer button.cf-danger-solid { border-color: #9a3b2a; background: #9a3b2a; color: #fff; }
.cf-using { margin: -8px 0 14px; border-radius: 8px; padding: 8px 12px; background: #e6f1eb; color: #1c4a3c; font-size: 12px; }
.cf-error { margin: 0 0 14px; border: 1px solid #f0c9c0; border-radius: 8px; padding: 9px 12px; background: #fdf1ee; color: #8a2f20; font-size: 12px; }
.cf-drop { display: grid; gap: 2px; margin: 0 0 24px; border: 1.5px dashed #b9cdc3; border-radius: 12px; padding: 14px 16px; background: #fff; color: #476056; font-size: 12px; }
.cf-drop strong { color: #173e32; font-size: 13px; }
.cf-drop.is-over { border-color: #1c6a57; background: #eef4f1; }
.cf-main h3 { margin: 0 0 10px; color: #476056; font-size: 13px; font-weight: 700; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 26px; }
.cf-card { display: flex; align-items: center; gap: 12px; border: 1px solid #dfe6e2; border-radius: 12px; padding: 13px 15px; background: #fff; color: #17231f; text-align: left; }
.cf-card:hover { border-color: #9fc6b2; background: #f5f9f7; }
.cf-card span { display: grid; gap: 2px; min-width: 0; }
.cf-card strong { font-size: 13px; overflow-wrap: anywhere; }
.cf-card small { color: #6c7d74; font: 400 10px "DM Mono", Manrope, monospace; }
.cf-docs { display: grid; gap: 8px; }
.cf-doc { border: 1px solid #dfe6e2; border-radius: 10px; padding: 12px 16px; background: #fff; }
.cf-doc-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cf-doc-main > span:first-child { display: grid; gap: 3px; min-width: 0; }
.cf-doc-main strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.cf-doc-main small { color: #6c7d74; font-size: 11px; }
.cf-also { margin: 8px 0 0; color: #6c7d74; font-size: 11px; line-height: 1.8; }
.cf-also em { border-radius: 999px; padding: 2px 9px; background: #eef4f1; color: #1c6a57; font-style: normal; font-weight: 600; }
.cf-empty { border: 1px dashed #cfdad4; border-radius: 12px; padding: 26px; color: #6c7d74; font-size: 13px; line-height: 1.7; text-align: center; }

.cf-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; background: #0d29234d; }
.cf-box { display: flex; flex-direction: column; gap: 14px; width: min(460px, 100%); max-height: 100%; border-radius: 14px; padding: 20px; background: #fff; box-shadow: 0 24px 60px #10261f40; }
.cf-box > strong { font-size: 16px; overflow-wrap: anywhere; }
.cf-box p { margin: 0; color: #3d5249; font-size: 13px; line-height: 1.7; }
.cf-box label { display: grid; gap: 6px; color: #476056; font-size: 12px; }
.cf-box input { border: 1px solid #b9d6c8; border-radius: 8px; padding: 10px 12px; color: #17231f; font: inherit; font-size: 14px; }
.cf-box-actions { justify-content: flex-end; }
.cf-box-actions > span { flex: 1; min-width: 0; color: #476056; font-size: 12px; overflow-wrap: anywhere; }
.cf-pick { width: min(520px, 100%); }
.cf-pick-list { flex: 1; min-height: 120px; max-height: 46vh; overflow: auto; border: 1px solid #e6ece8; border-radius: 10px; padding: 6px; }

.cf-chip { position: fixed; right: 20px; bottom: 20px; z-index: 1300; border-radius: 10px; padding: 10px 14px; background: #0d2923; color: #f4f8f5; font: 600 12px Manrope, Arial, sans-serif; box-shadow: 0 10px 30px #10261f40; }
.cf-chip-note { bottom: 64px; background: #5b4a1c; }
@media (max-width: 900px) {
  .cf-frame { flex-direction: column; height: auto; }
  .cf-tree { flex: 0 0 auto; max-height: 40dvh; border-right: 0; border-bottom: 1px solid #dfe6e2; }
  .cf-main { padding: 18px 16px 40px; }
}

/* Niveles del árbol (maqueta A aprobada, 15 nov 2026): icono y color por nivel. */
.cf-tree .cf-row > button:not(.cf-chev) { display: flex; align-items: center; gap: 9px; }
.cf-tree .cf-ico { flex: none; }
.cf-tree .cf-lbl { display: grid; gap: 1px; min-width: 0; }
.cf-tree .cf-row.cf-level0 > button:not(.cf-chev) { color: #17231f; font-size: 14px; font-weight: 700; }
.cf-tree .cf-row.cf-level1 > button:not(.cf-chev) { color: #1c4a3c; font-size: 13px; font-weight: 700; }
.cf-tree .cf-row.cf-levelf > button:not(.cf-chev) { color: #3d5249; font-weight: 500; }
.cf-tree .cf-row.cf-levelf.is-on > button:not(.cf-chev) { color: #123a2f; font-weight: 700; }

/* Explorador v3 (16 nov 2026): el expediente es el primer nivel; carpetas y archivos dentro, en cualquier nivel. */
.cf-tree-buttons { display: flex; gap: 6px; }
.cf-filter { margin: 0 6px 10px; width: calc(100% - 12px); border: 1px solid #cbd6d1; border-radius: 8px; padding: 7px 10px; background: #fff; color: #25433a; font: 600 12px Manrope, Arial, sans-serif; }
.cf-client-tools { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: -4px 8px 10px; }
.cf-client-tools button, .cf-explorer button.cf-danger-link { border: 0; padding: 0; background: none; color: #245d49; font: 600 11px Manrope, Arial, sans-serif; cursor: pointer; }
.cf-explorer button.cf-danger-link { color: #9a3b2a; }
.cf-tree .cf-row.cf-levelcase { margin-top: 6px; }
.cf-tree .cf-row.cf-levelcase > button:not(.cf-chev) { color: #17231f; font-size: 14px; font-weight: 700; }
.cf-tree .cf-row.cf-levelfile > button:not(.cf-chev) { color: #1c4a3c; font-size: 12.5px; font-weight: 500; }
.cf-tree .cf-row.cf-levelfile.is-on > button:not(.cf-chev) { font-weight: 700; }
.cf-tree .cf-row:hover { background: #eaf1ed; }
.cf-tree .cf-row.is-on { background: #d6e8df; }
.cf-explorer [draggable="true"] { cursor: grab; }
.cf-explorer .is-dragging { opacity: .45; }
.cf-explorer .cf-drop-ok { background: #d3ecdf !important; box-shadow: inset 0 0 0 2px #1c6a57; }
.cf-explorer .cf-drop-bad { background: #fbe9e5 !important; box-shadow: inset 0 0 0 2px #c96a58; }
.cf-list { overflow: hidden; margin-bottom: 18px; border: 1px solid #dfe6e2; border-radius: 12px; background: #fff; }
.cf-list-head, .cf-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) 160px auto; align-items: center; gap: 12px; padding: 9px 14px; }
.cf-list-head { border-bottom: 1px solid #dfe6e2; background: #f4f7f5; color: #476056; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cf-item { border-bottom: 1px solid #eef2ef; }
.cf-item:last-child { border-bottom: 0; }
.cf-item:hover { background: #fafcfb; }
.cf-item.is-picked { background: #e9f3ee; box-shadow: inset 3px 0 0 #1c6a57; }
.cf-explorer button.cf-item-name { min-width: 0; border: 0; padding: 0; background: none; color: #17231f; font-size: 14px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.cf-item-small { color: #56665f; font: 400 11px "DM Mono", Manrope, monospace; }
.cf-item-ops { display: flex; gap: 10px; opacity: 0; }
.cf-item:hover .cf-item-ops, .cf-item:focus-within .cf-item-ops { opacity: 1; }
.cf-item-ops button { border: 0; padding: 2px 0; background: none; color: #245d49; font: 600 12px Manrope, Arial, sans-serif; cursor: pointer; }
.cf-fileinfo { display: grid; gap: 6px; border: 1px solid #dfe6e2; border-radius: 12px; padding: 16px 18px; background: #fff; color: #3d5249; font-size: 13px; line-height: 1.7; }
.cf-fileinfo strong { color: #17231f; }
.cf-toast { position: fixed; right: 24px; bottom: 24px; z-index: 1300; display: flex; align-items: center; gap: 14px; border-radius: 10px; padding: 11px 14px; background: #0d2923; color: #f4f8f5; font: 500 13px Manrope, Arial, sans-serif; box-shadow: 0 10px 30px #10261f4d; }
.cf-toast button { border: 0; padding: 0; background: none; color: #e8c98a; font: 700 13px Manrope, Arial, sans-serif; cursor: pointer; }
@media (hover: none) { .cf-item-ops { opacity: 1; } }
@media (max-width: 700px) { .cf-list-head { display: none; } .cf-item { grid-template-columns: 22px minmax(0, 1fr); } .cf-item-small, .cf-item-ops { grid-column: 2; } }

/* 17 nov 2026 · el cliente encima del expediente (maqueta aprobada) */
.cf-tree .cf-row.cf-levelclient { margin-top: 8px; }
.cf-tree .cf-row.cf-levelclient > button:not(.cf-chev) { color: #1f3f5f; font-size: 14px; font-weight: 700; }
.cf-tree .cf-row.cf-levelnoclient { margin-top: 8px; }
.cf-tree .cf-row.cf-levelnoclient > button:not(.cf-chev) { color: #6c7d74; font-size: 13px; font-weight: 600; font-style: italic; }
.cf-tree .cf-row.cf-levelcase.cf-d1 { margin-top: 2px; }
.cf-tree .cf-row.cf-levelcase.cf-d1 > button:not(.cf-chev) { font-size: 13.5px; }
.cf-empty.cf-empty-client { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* 17 nov 2026 · sin panel lateral: la subida y su barra, dentro de la página del expediente */
body.cf-explorer-on #drawer-backdrop { display: none !important; }
body.cf-explorer-on #case-drawer:not(.cf-inline) { display: none !important; }
.cf-upslot[data-work="0"] { display: none; }
.cf-upslot { display: grid; gap: 8px; margin: 0 0 14px; }
.cf-upslot > .cf-eyebrow { margin: 0; }
.cf-upslot #case-drawer.cf-inline { position: static; z-index: auto; width: auto; height: auto; overflow: visible; transform: none; padding: 0; background: none; box-shadow: none; transition: none; }
.cf-upslot #case-drawer .drawer-header,
.cf-upslot #case-drawer .document-section > h3,
.cf-upslot #case-drawer .document-section > p:first-of-type,
.cf-upslot #case-drawer .upload-zone,
.cf-upslot #case-drawer #selected-document-name,
.cf-upslot #case-drawer .drawer-file-list-heading,
.cf-upslot #case-drawer form[id="upload-document-form"] button[type="submit"],
.cf-upslot #case-drawer .drawer-section:has(#assign-client-form),
.cf-upslot #case-drawer .drawer-section:has(#rename-form),
.cf-upslot #case-drawer .drawer-section:has(#request-deletion),
.cf-upslot #case-drawer .file-progress:has(.file-ready-mark) { display: none; }
.cf-upslot #case-drawer .drawer-section { margin: 0; border-top: 0; padding: 0; }
.cf-upslot #case-drawer .drawer-section + .drawer-section { margin-top: 12px; }
.cf-box select { border: 1px solid #b9d6c8; border-radius: 8px; padding: 10px 12px; background: #fff; color: #17231f; font: inherit; font-size: 14px; }

/* Errores de procesamiento: nota discreta en la lista, solo para el administrador */
.cf-item-issues { color: #9a3b2a; }
/* Numerar los PDF de una carpeta (26 nov 2026): fila con flechas, posición y nombre. */
.cf-row > .cf-num-name { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 7px 6px; color: #25433a; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.cf-box input.cf-num-pos { flex: 0 0 62px; width: 62px; padding: 6px 8px; font-size: 13px; }
.cf-chev:disabled { opacity: .3; }
