.markdown img { max-width: 100%; }
.markdown pre { background: var(--bs-tertiary-bg); padding: .75rem; border-radius: .375rem; }
.markdown table { width: auto; margin-bottom: 1rem; }
.markdown th, .markdown td { border: 1px solid var(--bs-border-color); padding: .25rem .5rem; }
.markdown blockquote { border-left: 3px solid var(--bs-border-color); padding-left: .75rem; color: var(--bs-secondary-color); }
.markdown .mermaid { background: #fff; text-align: center; }

.tarjeta-app { transition: box-shadow .15s; }
.tarjeta-app:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.08); }

.tablero { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tablero .columna { background: var(--bs-secondary-bg); border-radius: .5rem; padding: .5rem; min-height: 8rem; }

.select-estado { width: auto; min-width: 8.5rem; }
.arbol-1 { padding-left: 1.5rem; } .arbol-2 { padding-left: 3rem; } .arbol-3 { padding-left: 4.5rem; }

/* Gráficas del dashboard: un solo tono (magnitud), marcas finas con extremo redondeado de 4px */
.fila-barra { margin-bottom: .5rem; }
.barra-pista { height: 8px; }
.barra { height: 8px; min-width: 2px; background: var(--bs-primary); border-radius: 0 4px 4px 0; }
.fila-barra:hover .barra, .mes:hover .mes-barra { background: var(--bs-primary-text-emphasis); }
.meses { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--bs-border-color); }
.mes { flex: 1; display: flex; flex-direction: column; height: 100%; cursor: default; }
.mes-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.mes-barra { width: 60%; max-width: 22px; min-height: 0; background: var(--bs-primary); border-radius: 4px 4px 0 0; }
.mes-etiqueta { font-size: .65rem; color: var(--bs-secondary-color); text-align: center; margin-top: 2px; transform: translateY(1.1rem); }
.meses { margin-bottom: 1.4rem; }

/* Pestañas del proyecto: la activa y su contenido forman un panel blanco sobre el fondo gris de la página */
.pestanas { border-bottom: 0; gap: 2px; }
.pestanas .nav-link { color: var(--bs-secondary-color); border: 1px solid transparent; border-bottom: 0; }
.pestanas .nav-link:hover { color: var(--bs-body-color); background: var(--bs-secondary-bg); }
.pestanas .nav-link.active {
  position: relative; z-index: 1; margin-bottom: -1px; font-weight: 600;
  color: var(--bs-body-color); background: var(--bs-body-bg);
  border-color: var(--bs-border-color) var(--bs-border-color) var(--bs-body-bg);
}
.panel-pestana {
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: 0 .5rem .5rem .5rem; padding: 1.25rem;
}
.panel-pestana > :first-child { margin-top: 0; }
.panel-pestana > :last-child { margin-bottom: 0; }
.contador {
  display: inline-block; min-width: 1.5em; padding: 0 .45em; margin-left: .15em;
  font-size: .75em; line-height: 1.6; text-align: center; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: var(--bs-secondary-bg); color: var(--bs-secondary-color);
}
.nav-link.active .contador { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }

/* Selección múltiple con casillas */
.casillas { border: 1px solid var(--bs-border-color); border-radius: .375rem; background: var(--bs-body-bg); }
.casillas-buscar { border: 0; border-bottom: 1px solid var(--bs-border-color); border-radius: .375rem .375rem 0 0; }
.casillas-lista { max-height: 14rem; overflow-y: auto; padding: .5rem .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .15rem 1rem; }
.casillas-lista .form-check { margin: 0; }
.casillas-lista .form-check-input { margin-right: .4rem; }

/* Filas de enlaces y credenciales */
.fila-formset { border-bottom: 1px solid var(--bs-border-color); padding-bottom: .5rem; margin-bottom: .5rem; }

/* Editor visual: misma letra que el resto del portal */
.toastui-editor-defaultUI { font-family: inherit; }
.toastui-editor-contents { font-family: inherit; font-size: 1rem; }
.toastui-editor-contents p, .toastui-editor-contents li { font-size: 1rem; }

/* Títulos dentro del contenido (documentos, incidencias…): escala parecida a Notion y por debajo del título de la página */
.markdown h1, .toastui-editor-contents h1 { font-size: 1.6rem; font-weight: 700; margin: 1.6rem 0 .6rem; }
.markdown h2, .toastui-editor-contents h2 { font-size: 1.35rem; font-weight: 600; margin: 1.4rem 0 .5rem; }
.markdown h3, .toastui-editor-contents h3 { font-size: 1.15rem; font-weight: 600; margin: 1.2rem 0 .4rem; }
.markdown h4, .markdown h5, .markdown h6,
.toastui-editor-contents h4, .toastui-editor-contents h5, .toastui-editor-contents h6 { font-size: 1rem; font-weight: 600; margin: 1rem 0 .4rem; }
.markdown > :first-child, .toastui-editor-contents > :first-child { margin-top: 0; }
/* Toast UI pone una línea bajo h1 y h2: fuera, como en Notion */
.toastui-editor-contents h1, .toastui-editor-contents h2 { border-bottom: 0; padding-bottom: 0; }

/* Tabla de tiquets: la fila entera es el enlace */
.fila-enlace { cursor: pointer; }
.titulo-tiquet { color: var(--bs-body-color); text-decoration: none; font-weight: 500; }
.fila-enlace:hover .titulo-tiquet { color: var(--bs-primary); }
.num-tiquet { color: var(--bs-secondary-color); font-weight: 400; font-variant-numeric: tabular-nums; margin-right: .2rem; }
.tabla-tiquets td { padding-top: .5rem; padding-bottom: .5rem; }
.acciones-fila { width: 1%; }

/* Naranja de «Pendiente solicitante», igual que en el ticketing (--bs-naranja: #fd7e14) */
.text-bg-naranja { background-color: #fd7e14 !important; color: #fff !important; }

/* Migas de pan: discretas, sin subrayado */
.migas .breadcrumb { --bs-breadcrumb-divider: "›"; --bs-breadcrumb-margin-bottom: .5rem; font-size: .85rem; }
.migas a { color: var(--bs-secondary-color); text-decoration: none; }
.migas a:hover { color: var(--bs-primary); }
.migas .breadcrumb-item.active { color: var(--bs-body-color); }

/* Enlaces sin subrayado (solo al pasar el ratón) y en un azul más sobrio */
:root, [data-bs-theme="light"] { --bs-link-color: #1d5fa8; --bs-link-color-rgb: 29, 95, 168; --bs-link-hover-color: #154a85; --bs-link-hover-color-rgb: 21, 74, 133; }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a.btn:hover, a.badge:hover, a.nav-link:hover, a.dropdown-item:hover, a.list-group-item:hover, .migas a:hover, a.navbar-brand:hover { text-decoration: none; }

/* Azul principal más oscuro (botones, casillas, pestañas…), a juego con los enlaces */
:root, [data-bs-theme="light"] {
  --bs-primary: #1d5fa8; --bs-primary-rgb: 29, 95, 168;
  --bs-primary-text-emphasis: #123e6e; --bs-primary-bg-subtle: #dde8f5; --bs-primary-border-subtle: #a9c3e3;
  --bs-focus-ring-color: rgba(29, 95, 168, .25);
}
.btn-primary {
  --bs-btn-bg: #1d5fa8; --bs-btn-border-color: #1d5fa8;
  --bs-btn-hover-bg: #174f8c; --bs-btn-hover-border-color: #154a85;
  --bs-btn-active-bg: #154a85; --bs-btn-active-border-color: #13457c;
  --bs-btn-disabled-bg: #1d5fa8; --bs-btn-disabled-border-color: #1d5fa8;
  --bs-btn-focus-shadow-rgb: 29, 95, 168;
}
.btn-outline-primary {
  --bs-btn-color: #1d5fa8; --bs-btn-border-color: #1d5fa8;
  --bs-btn-hover-bg: #1d5fa8; --bs-btn-hover-border-color: #1d5fa8;
  --bs-btn-active-bg: #154a85; --bs-btn-active-border-color: #154a85;
  --bs-btn-disabled-color: #1d5fa8; --bs-btn-disabled-border-color: #1d5fa8;
  --bs-btn-focus-shadow-rgb: 29, 95, 168;
}
.form-check-input:checked { background-color: #1d5fa8; border-color: #1d5fa8; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #8fb0d6; box-shadow: 0 0 0 .25rem rgba(29, 95, 168, .25); }
.nav-pills { --bs-nav-pills-link-active-bg: #1d5fa8; }
.pagination { --bs-pagination-active-bg: #1d5fa8; --bs-pagination-active-border-color: #1d5fa8; }
.list-group { --bs-list-group-active-bg: #1d5fa8; --bs-list-group-active-border-color: #1d5fa8; }
.progress, .progress-stacked { --bs-progress-bar-bg: #1d5fa8; }
