/* =====================================================================
   CAMPUS TRIUNFAR · Documentos (Word y Excel) · v46
   Usa los colores del campus (css/campus.css) y le da a los editores
   botones redondeados y modernos.
   ===================================================================== */
.doc-pagina { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; min-width: 0; width: 100%; box-sizing: border-box; }
.embebido .doc-pagina { padding-top: 6px; }
.doc-cab h1 { font-family: var(--f-display); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 4px; color: var(--indigo); }
.doc-cab p { margin: 0 0 18px; max-width: 760px; }
.icn { width: 20px; height: 20px; flex: none; }
.icn-chico { width: 16px; height: 16px; }

/* ---------- Inicio: tres tarjetas grandes ---------- */
.doc-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 6px 0 18px; }
.doc-op { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 6px; align-content: start; padding: 22px; border-radius: 20px;
  background: var(--blanco); border: 1px solid var(--linea); box-shadow: var(--sombra); transition: transform .15s, box-shadow .15s, border-color .15s; }
.doc-op:hover { transform: translateY(-2px); border-color: #b9c8ef; box-shadow: 0 2px 4px rgba(14,26,59,.06), 0 16px 34px rgba(14,26,59,.12); }
.doc-op:focus-visible, .doc-op:focus-within { outline: 3px solid var(--azul); outline-offset: 2px; }
.doc-op b { font-family: var(--f-display); font-size: 1.08rem; color: var(--indigo); }
.doc-op small { color: var(--tinta-2); font-size: .9rem; line-height: 1.4; }
.doc-op-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; margin-bottom: 6px; }
.doc-op-ico .icn { width: 28px; height: 28px; }
.doc-op-ico.w { background: linear-gradient(135deg, #2B6BEA, #1A4FC7); }
.doc-op-ico.x { background: linear-gradient(135deg, #1E9E5A, #137A43); }
.doc-op-ico.a { background: linear-gradient(135deg, #F2B544, #E0901A); }
.doc-notas { display: grid; gap: 8px; background: #F2F6FF; border: 1px solid #DCE6FB; border-radius: 16px; padding: 14px 18px; color: var(--tinta-2); font-size: .92rem; }
.doc-notas p { margin: 0; }
.doc-borrador { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: #FFF8E8; border: 1px solid #F5DDA6; color: #6B4A00;
  border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; }
.doc-borrador > div:first-of-type { flex: 1 1 260px; display: grid; gap: 2px; }
.doc-borrador .icn { width: 26px; height: 26px; color: #C98500; }
.doc-borrador-acc { display: flex; gap: 8px; }
.doc-borrador.hidden { display: none; }

/* ---------- Barra del documento ---------- */
.doc-barra { position: sticky; top: 64px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--linea); border-radius: 16px; box-shadow: var(--sombra); }
.embebido .doc-barra { top: 0; }
.doc-barra .espacio { flex: 1; }
.doc-barra .btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 12px; }
.doc-tipo { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-weight: 800; font-size: .84rem; color: #fff; }
.doc-tipo .icn { width: 17px; height: 17px; }
.doc-tipo.w { background: #2B6BEA; } .doc-tipo.x { background: #1E9E5A; }
.doc-nombre { flex: 1 1 170px; min-width: 0; max-width: 320px; }
.doc-nombre input { padding: 8px 12px; border-radius: 10px; font-weight: 700; min-height: 0; }
.doc-estado { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-menu-caja { position: relative; }
.doc-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 270px; background: var(--blanco); border: 1px solid var(--linea);
  border-radius: 14px; box-shadow: 0 14px 36px rgba(14,26,59,.18); padding: 6px; display: grid; gap: 2px; }
.doc-menu.hidden { display: none; }
.doc-menu button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--tinta); }
.doc-menu button:hover, .doc-menu button:focus-visible { background: #F0F4FF; }
.doc-menu button:focus-visible { outline: 2px solid var(--azul); }
.doc-menu button .icn { width: 26px; height: 26px; color: var(--azul-2); }
.doc-menu button span { display: grid; }
.doc-menu button small { color: var(--tinta-2); font-size: .8rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Word: hoja blanca tamaño carta ---------- */
.doc-hoja-caja { background: #E9EDF5; border-radius: 18px; padding: 18px; }
.doc-hoja-caja .jodit-container:not(.jodit_inline) { max-width: 900px !important; margin: 0 auto; border-radius: 14px; border-color: var(--linea); box-shadow: 0 8px 26px rgba(14,26,59,.10); overflow: visible; }

.doc-hoja-caja .jodit-workplace { position: relative; background: #E3E8F1 !important; padding: 22px 0 30px; overflow: visible !important; }
/* La hoja: ancho carta (8,5") con márgenes de 1", así las líneas caen igual que en Word y en el PDF */
.doc-hoja-caja .jodit-wysiwyg { width: 816px !important; max-width: 100% !important; box-sizing: border-box; margin: 0 auto !important; padding: 96px !important; background: #fff;
  box-shadow: 0 1px 3px rgba(14,26,59,.12), 0 6px 18px rgba(14,26,59,.08); min-height: var(--doc-hoja-alto, 1056px); }
/* Botones del editor: redondeados, con aire y color al pasar */
.jodit-toolbar__box:not(:empty) { background: #F7F9FD !important; border-bottom: 1px solid var(--linea) !important; border-radius: 14px 14px 0 0; }
.jodit-toolbar-editor-collection_mode_horizontal { background-image: none !important; }
.jodit-toolbar-button { border-radius: 9px !important; margin: 2px !important; }
.jodit-toolbar-button__button { border-radius: 9px !important; }
.jodit-toolbar-button:hover:not([disabled]), .jodit-toolbar-button__button:hover:not([disabled]) { background: #E6EDFF !important; }
.jodit-toolbar-button_with-trigger_true:hover:not([disabled]) { border-color: #C9D6F8 !important; }
.jodit-toolbar-button[aria-pressed="true"] .jodit-toolbar-button__button, .jodit-toolbar-button__button[aria-pressed="true"] { background: #DCE6FF !important; color: var(--azul-2) !important; }
.jodit-toolbar-button .jodit-icon { fill: #33405E !important; }
.jodit-ui-separator { border-color: #DCE2F0 !important; }
.jodit-status-bar { background: #F7F9FD !important; border-radius: 0 0 14px 14px; color: var(--tinta-2) !important; }
.jodit-popup__content { border-radius: 12px !important; }
.jodit-ui-button_variant_primary { background: var(--azul) !important; border-radius: 9px !important; }
.jodit-wysiwyg table { border-collapse: collapse; width: 100%; }
.jodit-wysiwyg td, .jodit-wysiwyg th { border: 1px solid #9aa3b5; padding: 4px 6px; min-width: 2em; }
.jodit-wysiwyg img { max-width: 100%; height: auto; }

/* ---------- Excel ---------- */
#editorExcel { border: 1px solid var(--linea); border-radius: 16px; overflow: hidden; box-shadow: var(--sombra); background: #fff; }
.doc-ayuda-x { margin: 10px 4px 0; }
.doc-ayuda-x code { background: #EEF2FB; padding: 1px 6px; border-radius: 6px; font-size: .86em; }
#editorExcel .x-spreadsheet-toolbar { background: #F7F9FD; padding: 0 10px; height: auto; min-height: 44px; flex-wrap: wrap; }
#editorExcel .x-spreadsheet-toolbar-btn { border-radius: 9px; margin: 6px 2px; height: 30px; line-height: 30px; min-width: 30px; transition: background .12s; }
#editorExcel .x-spreadsheet-toolbar-btn:hover, #editorExcel .x-spreadsheet-toolbar-btn.active { background: #E6EDFF; }
#editorExcel .x-spreadsheet-toolbar-btn .x-spreadsheet-icon { margin-top: 5px; }
#editorExcel .x-spreadsheet-icon .x-spreadsheet-icon-img { opacity: .7; }
#editorExcel .x-spreadsheet-bottombar { background: #F7F9FD; padding: 0 10px; }
#editorExcel .x-spreadsheet-menu > li { font-weight: 700; color: var(--tinta-2); border-radius: 10px 10px 0 0; }
#editorExcel .x-spreadsheet-menu > li.active { color: var(--azul-2); background: #fff; box-shadow: inset 0 3px 0 var(--azul); }
#editorExcel .x-spreadsheet-dropdown-content { border-radius: 10px; }
#editorExcel .x-spreadsheet-toolbar-divider { margin-top: 13px; }
#editorExcel .x-spreadsheet { font-family: Arial, Helvetica, sans-serif; }

/* ---------- Esperando ---------- */
.doc-velo { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(14,26,59,.35); }
.doc-velo > div { display: flex; align-items: center; gap: 12px; background: #fff; padding: 16px 22px; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.2); }
.doc-giro { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #D5DEF5; border-top-color: var(--azul); animation: docGiro .8s linear infinite; }
@keyframes docGiro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .doc-giro { animation-duration: 2.5s; } .doc-op { transition: none; } }
#docMedidas { position: fixed; left: -20000px; top: 0; width: 1100px; pointer-events: none; }
#docMedidas .doc-pag { margin-bottom: 10px; }
#docMedidas table { border-collapse: collapse; }
#docMedidas .jodit-wysiwyg td, #docMedidas .jodit-wysiwyg th { border: 1px solid #9aa3b5; padding: 4px 6px; }
#docMedidas img { max-width: 100%; height: auto; }
#docMedidas p { margin: 0 0 8px; }
.doc-form-tarea { display: grid; gap: 12px; }
.doc-form-tarea .fila { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .doc-pagina { padding: 14px 12px 50px; }
  .doc-barra { top: 0; gap: 8px; border-radius: 14px; }
  .doc-barra .btn span { display: none; }
  .doc-barra .btn { padding: 9px 11px; }
  .doc-nombre { flex: 1 1 100%; max-width: none; order: 5; }
  .doc-estado { order: 6; flex-basis: 100%; }
  .doc-hoja-caja { padding: 0; background: none; }
  .doc-hoja-caja .jodit-wysiwyg { padding: 18px 16px !important; min-height: 420px; }
  .doc-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; min-width: 0; }
  .doc-form-tarea .fila { grid-template-columns: 1fr; }
}

/* Títulos y párrafos como en Word (no los del campus) — en el editor y en las páginas de PDF/JPG */
.jodit-wysiwyg h1, .jodit-wysiwyg h2, .jodit-wysiwyg h3, .jodit-wysiwyg h4, .jodit-wysiwyg h5, .jodit-wysiwyg h6,
#docMedidas h1, #docMedidas h2, #docMedidas h3, #docMedidas h4, #docMedidas h5, #docMedidas h6 {
  font-family: Calibri, Arial, sans-serif; color: #1F4E9A; font-weight: bold; line-height: 1.25; margin: 14px 0 6px; letter-spacing: 0; }
.jodit-wysiwyg h1, #docMedidas h1 { font-size: 18pt; } .jodit-wysiwyg h2, #docMedidas h2 { font-size: 15pt; }
.jodit-wysiwyg h3, #docMedidas h3 { font-size: 13pt; } .jodit-wysiwyg h4, #docMedidas h4 { font-size: 12pt; }
.jodit-wysiwyg h5, .jodit-wysiwyg h6, #docMedidas h5, #docMedidas h6 { font-size: 11pt; }
.jodit-wysiwyg p, #docMedidas p { margin: 0 0 8px; }
.jodit-wysiwyg ul, .jodit-wysiwyg ol, #docMedidas ul, #docMedidas ol { margin: 0 0 8px; padding-left: 28px; }
.jodit-wysiwyg a, #docMedidas a { color: #0563C1; }

/* Selector de hoja (carta u oficio) y cuántas hojas lleva */
.doc-hoja-sel { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .86rem; color: var(--tinta-2); }
.doc-hoja-sel select { width: auto; padding: 7px 30px 7px 10px; border-radius: 10px; min-height: 0; font-weight: 700; font-size: .9rem; }
.doc-hojas { font-size: .82rem; font-weight: 700; color: var(--azul-2); background: #EEF3FF; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.doc-hojas:empty { display: none; }
/* Línea donde termina una hoja */
.doc-cortes { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.doc-corte { position: absolute; left: 50%; transform: translateX(-50%); width: min(816px, 100%); height: 12px; border-top: 2px dashed #7D8BB0; }
.doc-corte span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); background: #7D8BB0; color: #fff; font: 700 11px/1 Figtree, Arial, sans-serif;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
/* El tamaño de letra se ve en su botón */
.jodit-toolbar-button__button.doc-con-tam .jodit-toolbar-button__icon { display: none; }
.doc-tam { min-width: 30px; padding: 0 4px; font: 700 13px/1 Arial, sans-serif; color: #1D2A48; text-align: center; border: 1px solid #C9D3EA; border-radius: 6px; background: #fff; height: 22px; line-height: 20px; box-sizing: border-box; }
@media (max-width: 760px) {
  .doc-hoja-caja .jodit-workplace { padding: 0; background: #fff !important; }
  .doc-hoja-caja .jodit-wysiwyg { width: auto !important; padding: 18px 16px !important; box-shadow: none; }
  .doc-corte span { font-size: 10px; }
}

@media (max-width: 900px) { .doc-hoja-caja .jodit-wysiwyg { width: auto !important; } }
/* Excel en español: N (negrita), K (cursiva), S (subrayado) en lugar de B, I, U */
#editorExcel .x-spreadsheet-icon-img.font-bold, #editorExcel .x-spreadsheet-icon-img.font-italic, #editorExcel .x-spreadsheet-icon-img.underline { background-image: none; }
#editorExcel .x-spreadsheet-icon-img.font-bold::after, #editorExcel .x-spreadsheet-icon-img.font-italic::after, #editorExcel .x-spreadsheet-icon-img.underline::after {
  position: absolute; width: 18px; height: 18px; text-align: center; font: bold 15px/18px Arial, Helvetica, sans-serif; color: #000; }
#editorExcel .x-spreadsheet-icon-img.font-bold::after { content: 'N'; left: 90px; top: 0; }
#editorExcel .x-spreadsheet-icon-img.font-italic::after { content: 'K'; font-style: italic; left: 108px; top: 0; }
#editorExcel .x-spreadsheet-icon-img.underline::after { content: 'S'; text-decoration: underline; left: 126px; top: 0; }
@media (max-width: 900px) {
  .doc-hoja-caja .jodit-workplace { overflow: hidden !important; }
  .doc-hoja-caja .jodit-placeholder { max-width: calc(100% - 32px); overflow: hidden; white-space: nowrap; }
}
/* v49: fondo o marca de agua */
#btnFondo.activo { background: #E8F0FF; border-color: #9DB5EC; color: #1B3FA0; }
.fo-tipos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.fo-tipos label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #D6DCEA; border-radius: 12px; cursor: pointer; font-weight: 600; }
.fo-tipos label:has(input:checked) { border-color: #2F5BD3; background: #EEF3FF; color: #1B3FA0; }
.fo-tipos .icn { width: 18px; height: 18px; }
.fo-cuerpo { display: grid; grid-template-columns: 1fr 190px; gap: 18px; align-items: start; }
.fo-opciones .campo { margin-top: 12px; }
.fo-opciones input[type=range] { width: 100%; accent-color: #2F5BD3; }
.fo-opciones input[type=color] { width: 64px; height: 36px; padding: 2px; }
.fo-elegir { cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.fo-elegir .icn { width: 16px; height: 16px; }
.fo-vista { margin: 0; text-align: center; }
.fo-vista img { width: 100%; aspect-ratio: 816 / 1056; object-fit: fill; border: 1px solid #D6DCEA; border-radius: 6px; box-shadow: 0 6px 18px rgba(20, 35, 80, .12); background: #fff; }
@media (max-width: 620px) { .fo-cuerpo { grid-template-columns: 1fr; } .fo-vista { max-width: 160px; margin: 0 auto; } }
.acciones .espacio { flex: 1; }
.fo-tipos input[type=radio] { width: auto; margin: 0; flex: none; }
.fo-tipos label { white-space: nowrap; justify-content: flex-start; }
/* v49: Poner como tarea → programas que se abren con un clic */
.tc-lista { max-height: 300px; overflow-y: auto; border: 1px solid #D6DCEA; border-radius: 12px; padding: 8px; background: #FAFBFE; margin: 6px 0 12px; }
.tc-inst h4 { margin: 6px 4px 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #5B6785; }
.tc-grupo { background: #fff; border: 1px solid #E3E8F3; border-radius: 10px; margin-bottom: 6px; }
.tc-grupo summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; list-style: none; }
.tc-grupo summary::-webkit-details-marker { display: none; }
.tc-grupo summary::before { content: '▸'; color: #7D8BB0; transition: transform .15s; }
.tc-grupo[open] summary::before { transform: rotate(90deg); }
.tc-grupo summary small { color: #6B7794; }
.tc-grupo .tc-n { margin-left: auto; font-size: .76rem; background: #EEF2FB; color: #3F4B6B; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tc-grupo summary:focus-visible { outline: 3px solid #2F5BD3; outline-offset: 2px; border-radius: 10px; }
.tc-mods { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 12px 28px; }
.tc-mod { border: 1px solid #C9D3EA; background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; cursor: pointer; color: #1E2A47; }
.tc-mod:hover { border-color: #2F5BD3; background: #F2F6FF; }
.tc-mod.activo { background: #2F5BD3; border-color: #2F5BD3; color: #fff; font-weight: 700; }
.tc-mod:focus-visible { outline: 3px solid #2F5BD3; outline-offset: 2px; }
.tc-elegido { margin-top: 2px; }
.tc-elegido b { color: #1B3FA0; }
/* v50: figuras flotantes del Word (detrás o delante del texto, sin correrlo) */
.jodit-wysiwyg, .doc-pag { isolation: isolate; }
.doc-ancla { position: relative; height: 0 !important; margin: 0 !important; padding: 0 !important; line-height: 0; font-size: 0; }
.doc-flota { position: absolute; z-index: 2; font-size: 11pt; line-height: 1.2; }
.doc-flota.detras { z-index: -1; }
.doc-flota img { max-width: none !important; height: auto; }
.doc-flota .doc-figura { overflow: visible; }
.doc-flota .doc-figura p { margin: 0 !important; }
/* fórmulas */
.doc-formula { display: inline-block; padding: 0 2px; border-radius: 4px; cursor: pointer; vertical-align: middle; font-size: 1.08em; }
.doc-formula.bloque { display: block; text-align: center; margin: 6px 0; }
.jodit-wysiwyg .doc-formula:hover { background: #EEF3FF; outline: 1px dashed #9DB5EC; }
.jodit-wysiwyg .doc-formula.sel { outline: 2px solid #2F5BD3; }
.doc-formula math, .fx-vista math { font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', 'Times New Roman', serif; }
/* salto de página */
.doc-salto { margin: 10px 0; border-top: 2px dashed #9DB5EC; color: #5B6785; font: 600 11px/1 Figtree, Arial, sans-serif; text-align: center; padding-top: 4px; user-select: none; }
#docMedidas .doc-salto, .doc-pag .doc-salto { display: none; }
/* ventana de fórmulas */
.fx-teclas { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.fx-tecla { min-width: 40px; height: 36px; padding: 0 10px; border: 1px solid #D6DCEA; border-radius: 9px; background: #fff; cursor: pointer; font: 600 15px/1 'Cambria Math', 'Times New Roman', serif; color: #1E2A47; }
.fx-tecla:hover { border-color: #2F5BD3; background: #F2F6FF; }
.fx-tecla:focus-visible { outline: 3px solid #2F5BD3; outline-offset: 1px; }
#fxTxt { font: 16px/1.4 Consolas, 'Courier New', monospace; }
.fx-vista { min-height: 64px; display: flex; align-items: center; justify-content: center; border: 1px solid #E3E8F3; border-radius: 12px; background: #FAFBFE; padding: 12px; font-size: 1.6rem; overflow-x: auto; }
.doc-formula math { math-style: normal; }

/* v61: barra de fórmulas */
.barra-fx { display: flex; align-items: stretch; border: 1px solid #D8DEE9; border-bottom: 0; border-radius: 10px 10px 0 0; background: #fff; overflow: hidden; }
.barra-fx .fx-ref { min-width: 64px; padding: 0 10px; display: grid; place-items: center; font: 600 .82rem/1 ui-monospace, Consolas, monospace; color: #23314F; background: #F4F6FA; border-right: 1px solid #D8DEE9; }
.barra-fx .fx-ico { padding: 0 10px; display: grid; place-items: center; font: italic 700 .85rem Georgia, serif; color: #2B7A3D; border-right: 1px solid #E6EAF1; }
.barra-fx input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 9px 10px; font: .9rem/1.2 Arial, sans-serif; color: #0a0a0a; background: #fff; }
.barra-fx input:focus { box-shadow: inset 0 -2px 0 #2B7A3D; }
.barra-fx.dentro { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 1px solid #E0E4EC; }
