/* Estilos propios de atlas-bd. La base (colores, tarjetas, botones) es
   style.css, copiado de atlas-nucleo para que las dos apps se vean igual. */
.bd-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.bd-cabecera h1 { margin: 0; }

.bd-vacio {
  text-align: center;
  padding: 2.5rem 1rem;
}

.bd-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.bd-item h2 { margin: 0 0 0.25rem; }
.bd-cifras { display: flex; gap: 1rem; color: var(--muted); font-size: 0.9rem; }

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
a.btn { text-decoration: none; display: inline-block; }
.bd-acciones { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.bd-enlace { color: inherit; text-decoration: none; }
.bd-enlace:hover { border-color: var(--accent); }
.bd-donde { font-size: 0.85rem; margin-top: 2rem; }

/* Asistente de migración */
.bd-pasos { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.85rem; }
.bd-paso { padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.bd-paso.activo { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.bd-paso.hecho { color: var(--ok); border-color: var(--ok); }
.bd-fichero { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bd-cargando::before {
  content: ""; display: inline-block; width: 0.9rem; height: 0.9rem; margin-right: 0.5rem;
  border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: bd-giro 0.8s linear infinite; vertical-align: -2px;
}
@keyframes bd-giro { to { transform: rotate(360deg); } }
.alert-aviso { background: var(--warn-bg); color: var(--warn-fg); }

/* Revisión */
/* 29/09/2026, pedido de Javi: contadores más discretos (la mitad) */
.bd-resumen { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bd-cifra.card { text-align: center; padding: 0.35rem 0.8rem; font-size: 0.8rem; color: var(--muted); border-radius: 10px; box-shadow: none; }
.bd-cifra strong { display: block; font-size: 1rem; color: var(--fg); }
.bd-tabla-scroll { overflow-x: auto; }
.bd-avisos li { margin-bottom: 0.35rem; }
.bd-nivel-error { color: var(--bad); }
.bd-nivel-aviso { color: var(--warn-fg); }
td.num, th.num { text-align: right; }
.bd-informe { list-style: none; padding-left: 0; }
.bd-informe li { margin-bottom: 0.45rem; }
label.btn { display: inline-block; width: auto; }

/* Páginas con tablas anchas: más espacio y el texto largo se parte en
   varias líneas en vez de salirse. */
body.bd-ancho main { max-width: 90rem; }
.bd-tabla-scroll td, .bd-tabla-scroll th { overflow-wrap: break-word; vertical-align: top; }
.bd-tabla-scroll td.bd-corto { white-space: nowrap; }
.bd-tabla-scroll code { overflow-wrap: break-word; }
.bd-campos-rel div + div { margin-top: 0.2rem; }

/* Botones flotantes "Subir" y "Bajar" */
.bd-flotantes {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 20;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch;
}
.bd-flotante { box-shadow: var(--shadow); display: none; }
.bd-flotante.visible { display: block; }

/* Ficha de tabla */
.bd-barra-datos { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.bd-barra-datos input[type=search] { flex: 1 1 16rem; font: inherit; padding: 0.45rem 0.7rem;
  border: 1px solid var(--border); border-radius: 0.6rem; background: var(--card-bg); color: var(--fg); }
.bd-barra-datos .bd-acciones { margin-left: auto; }
.bd-datos td { white-space: nowrap; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.bd-datos { max-height: 70vh; overflow: auto; }
.bd-datos thead th { position: sticky; top: 0; background: var(--bg); z-index: 1; }

/* Ficha de relación */
.bd-rel-esquema { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.bd-rel-lado { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 1rem;
  border: 1px solid var(--border); border-radius: 0.8rem; min-width: 12rem; }
.bd-rel-flecha { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 0.9rem; }
.bd-rel-flecha span:last-child { font-size: 1.6rem; color: var(--accent); }
.bd-abrir-ficha { margin-top: 0.75rem; }

/* Diagrama: todo el ancho de la ventana, barra lateral estrecha (los
   nombres largos pasan a dos líneas) y lienzo más grande. */
body.bd-completo main { max-width: none; }
body.bd-completo .schema-sidebar { flex: 0 0 190px; max-width: 190px; }
body.bd-completo .schema-entity-item span:last-of-type { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
body.bd-completo .schema-entity-item { align-items: flex-start; }
body.bd-completo .schema-entity-list { max-height: 72vh; }
body.bd-completo .schema-canvas-col { min-width: 0; }
body.bd-completo .schema-canvas-wrap { height: 72vh; }
.bd-selector { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; width: 100%; }
.bd-selector select { flex: 1; font: inherit; padding: 0.25rem; }
body.bd-completo .schema-domain-heading { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; user-select: none; }
body.bd-completo .schema-domain-heading:hover { color: var(--fg); }
.bd-grupo-flecha { width: 0.8rem; }
.bd-grupo-nombre { flex: 1; }
.bd-grupo-cuenta { font-weight: 400; text-transform: none; letter-spacing: 0; }
.bd-grupo-solo { font-size: 0.65rem; padding: 0.05rem 0.35rem; margin: 0; text-transform: none; cursor: pointer; }
.schema-entity-item[hidden] { display: none; }
.bd-grupos-acciones { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); width: 100%; }

/* Separador arrastrable entre la columna de tablas y el lienzo */
body.bd-completo .schema-layout { gap: 0; align-items: stretch; }
body.bd-completo .schema-sidebar { padding-right: 0.5rem; }
body.bd-completo .schema-canvas-col { padding-left: 0.5rem; }
.bd-separador { flex: 0 0 8px; cursor: col-resize; border-radius: 4px; position: relative; }
.bd-separador::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--border); }
.bd-separador:hover::after, .bd-separador.activo::after { background: var(--accent); width: 3px; }
.schema-sidebar-actions button.bd-activo { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* Sin acceso (el menú de Atlas no da permiso) */
.bd-sin-acceso { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 1rem; }
.bd-sin-acceso .card { max-width: 30rem; text-align: center; }

/* Fase 2: editar filas */
.bd-datos tbody tr.bd-editable { cursor: pointer; }
.bd-datos tbody tr.bd-editable:hover td { background: var(--warn-bg); }
.bd-dialogo { border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; width: min(640px, 94vw);
  max-height: 90vh; background: var(--bg); color: inherit; }
.bd-dialogo::backdrop { background: rgba(0,0,0,0.35); }
.bd-dialogo h2 { margin-top: 0; }
.bd-ficha-campos { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.bd-ficha-campos label { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.bd-ficha-campos .muted { font-weight: 400; font-size: 0.8rem; }
.bd-ficha-campos input, .bd-ficha-campos select, .bd-ficha-campos textarea { width: 100%; box-sizing: border-box; }
.bd-ficha-campos textarea { min-height: 4.5rem; font: inherit; }
.bd-ficha-botones { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.bd-zona-peligro { border-color: var(--bad); margin-top: 2rem; }
.bd-cabecera-seccion { margin: 1.5rem 0 0.5rem; }
.bd-cabecera-seccion h2 { margin: 0; }
.bd-deshacer-linea { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
/* Lo que lleva "hidden" se oculta siempre, aunque su estilo diga lo contrario */
[hidden] { display: none !important; }

/* Fase 4, tanda 2: botones de cada campo */
.bd-botones-campo { white-space: nowrap; }
.bd-imp-lista { max-height: 16rem; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.6rem; }
.bd-imp-lista label { display: flex; gap: 0.5rem; align-items: baseline; font-weight: 400; margin: 0.15rem 0; }
.bd-imp-lista input { width: auto; }

/* 28/09/2026: botón "Ficha" en cada tabla del diagrama, visible al pasar el ratón */
.schema-entity-card-header { position: relative; }
.bd-ir-ficha { display: none; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%);
  background: var(--bg, #fff); color: var(--fg, #222); border-radius: 6px; padding: 0.05rem 0.45rem;
  font-size: 0.75rem; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,0.25); z-index: 2; }
.schema-entity-card:hover .bd-ir-ficha { display: inline-block; }
.bd-ir-ficha:hover { text-decoration: underline; }

/* 28/09/2026: Historial */
.bd-h-deshecho td { opacity: 0.55; }
.bd-h-deshecho td:nth-child(2) { text-decoration: line-through; }
.bd-h-cambios { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }

/* 30/09/2026: hoja editable (doble clic en una tabla del Diagrama) */
.bd-hoja { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; width: 96vw; max-width: 96vw;
  height: 92vh; max-height: 92vh; background: var(--bg); color: inherit; box-sizing: border-box; }
.bd-hoja[open] { display: flex; flex-direction: column; }
.bd-hoja::backdrop { background: rgba(0,0,0,0.35); }
.bd-hoja-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.bd-hoja-cab h2 { margin: 0; }
.bd-hoja-cab p { margin: 0.2rem 0 0; font-size: 0.85rem; }
.bd-hoja-ayuda { font-size: 0.75rem; margin: 0.4rem 0; }
.bd-hoja-msg { padding: 0.35rem 0.7rem; border-radius: 8px; margin-bottom: 0.4rem; font-size: 0.9rem; }
.bd-hoja-msg.ok { background: var(--ok-bg); color: var(--ok); }
.bd-hoja-msg.error { background: var(--bad-bg); color: var(--bad); }
.bd-hoja-scroll { flex: 1; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); }
.bd-hoja-tabla { border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.bd-hoja-tabla th, .bd-hoja-tabla td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 0.25rem 0.5rem; min-width: 7rem; max-width: 22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  height: 1.7rem; box-sizing: border-box; }
.bd-hoja-tabla thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 0; }
.bd-hoja-th { display: flex; align-items: stretch; }
.bd-hoja-col { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; border: 0; background: none;
  color: inherit; font: inherit; font-weight: 600; padding: 0.35rem 0.5rem; cursor: pointer; text-align: left; min-width: 0; }
.bd-hoja-col:hover, .bd-hoja-cfg:hover { background: var(--ok-bg); }
.bd-hoja-ordenada { box-shadow: inset 0 -2px 0 var(--accent); }
.bd-hoja-cfg { border: 0; border-left: 1px solid var(--border); background: none; color: var(--muted); cursor: pointer; padding: 0 0.4rem; }
.bd-hoja-col-nombre { overflow: hidden; text-overflow: ellipsis; max-width: 20rem; }
.bd-hoja-col-tipo { font-size: 0.7rem; font-weight: 400; color: var(--muted); }
.bd-hoja-tabla .bd-hoja-esquina, .bd-hoja-tabla .bd-hoja-num { position: sticky; left: 0; z-index: 1; background: var(--bg);
  min-width: 4.5rem; color: var(--muted); font-size: 0.75rem; }
.bd-hoja-tabla thead .bd-hoja-esquina { z-index: 3; }
.bd-hoja-num { display: table-cell; }
.bd-hoja-num span { margin-left: 0.3rem; }
.bd-hoja-borrar { border: 0; background: none; cursor: pointer; opacity: 0.35; padding: 0; font-size: 0.8rem; }
tr:hover .bd-hoja-borrar { opacity: 1; }
.bd-hoja-borrar.confirmar { opacity: 1; color: var(--bad); font-weight: 600; }
.bd-celda { cursor: cell; }
.bd-celda.bd-num { text-align: right; }
.bd-celda.bd-sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.bd-celda.bd-editando { padding: 0; overflow: visible; }
.bd-hoja-fk { color: var(--muted); font-size: 0.8em; }
.bd-hoja-editor { width: 100%; min-width: 7rem; box-sizing: border-box; font: inherit; padding: 0.2rem 0.4rem;
  border: 2px solid var(--accent); border-radius: 0; background: var(--bg); color: inherit; }
textarea.bd-hoja-editor { min-height: 4rem; position: relative; z-index: 2; }
.bd-hoja-nueva td { background: var(--warn-bg); padding: 0.15rem; }
.bd-hoja-nueva .bd-hoja-editor { border-width: 1px; }
/* 30/09/2026: mover columnas arrastrando su título */
.bd-hoja-col[draggable="true"] { cursor: grab; }
.bd-hoja-arrastrando { opacity: 0.45; }
.bd-hoja-tabla thead th.bd-hoja-soltar-izq { box-shadow: inset 3px 0 0 var(--accent); }
.bd-hoja-tabla thead th.bd-hoja-soltar-der { box-shadow: inset -3px 0 0 var(--accent); }

/* 30/09/2026: importar hoja de cálculo */
.bd-imp-destino { display: grid; gap: 0.5rem; }
.bd-imp-sub { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0 0 0.5rem 1.6rem; }
.bd-imp-sub label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
.bd-imp-hoja { margin-bottom: 1rem; }
.bd-imp-hoja.bd-imp-fuera { opacity: 0.55; }
.bd-imp-hoja-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.bd-imp-marca { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.bd-imp-marca input { width: auto; }
.bd-imp-opciones { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.6rem 0; }
.bd-imp-opciones label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; }
.bd-imp-scroll { overflow: auto; max-height: 26rem; border: 1px solid var(--border); border-radius: 8px; }
.bd-imp-tabla { border-collapse: collapse; font-size: 0.8rem; }
.bd-imp-tabla th, .bd-imp-tabla td { border: 1px solid var(--border); padding: 0.25rem 0.4rem; white-space: nowrap;
  max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.bd-imp-tabla th { background: var(--bg); position: sticky; top: 0; vertical-align: top; min-width: 9rem; }
.bd-imp-tabla th input[type=text], .bd-imp-tabla th select { display: block; width: 100%; box-sizing: border-box; margin-top: 0.2rem; font-size: 0.8rem; }
.bd-imp-tabla .bd-imp-fuera { opacity: 0.35; }
/* 📤 Exportar */
.bd-exportar { position: relative; display: inline-block; }
.bd-exportar-menu { position: absolute; right: 0; top: 100%; z-index: 20; display: flex; flex-direction: column; min-width: 22rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 0.3rem; }
.bd-exportar-menu[hidden] { display: none; }
.bd-exportar-menu button { text-align: left; border: 0; background: none; color: inherit; font: inherit; padding: 0.45rem 0.6rem; border-radius: 6px; cursor: pointer; }
.bd-exportar-menu button:hover { background: var(--ok-bg); }
/* 30/09/2026: ventanas arrastrables (se cogen por el título) */
dialog[open] h2 { cursor: move; user-select: none; }
dialog.bd-arrastrando { cursor: move; user-select: none; }
/* 30/09/2026: columnas ocultables escondidas en la hoja */
.bd-hoja-tabla .bd-oculta { display: none; }
/* 30/09/2026: campo de solo lectura (nombre interno) */
input.bd-solo-lectura { background: transparent; border-style: dashed; color: var(--muted); font-family: ui-monospace, Menlo, monospace; cursor: default; }
/* 30/09/2026: 🗑 borrar tabla, a la izquierda de «✏️ Ficha» */
.bd-ir-ficha.bd-borrar-tabla { right: 4.6rem; border: 0; cursor: pointer; font-family: inherit; font-size: 0.75rem; }
/* 30/09/2026: la tabla editable se ajusta al contenido (sin huecos en blanco) */
.bd-hoja-tabla { width: auto !important; max-width: none; table-layout: auto; }
.bd-hoja-tabla th, .bd-hoja-tabla td { min-width: 3rem; width: auto; }
.bd-hoja-tabla .bd-hoja-esquina, .bd-hoja-tabla .bd-hoja-num { min-width: 0; white-space: nowrap; }
.bd-hoja-col-nombre { white-space: nowrap; }
/* 30/09/2026: borde para cambiar el ancho de una columna a mano */
.bd-hoja-tabla thead th { position: sticky; }
.bd-hoja-redim { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 3; }
.bd-hoja-redim:hover { background: var(--accent); opacity: 0.5; }

/* 02/10/2026: flecha para elegir otro valor en campos enlazados */
.bd-hoja-fk-flecha { float: right; margin-left: .5em; color: var(--muted); cursor: pointer; padding: 0 .2em; }
.bd-hoja-fk-flecha:hover { color: inherit; }

/* 02/10/2026: 🗑 delante de la casilla en la lista de tablas del Diagrama */
.bd-lista-borrar { flex: none; border: 0; background: none; padding: 0 2px; margin-right: 2px; cursor: pointer; font-size: 13px; line-height: 1; opacity: .45; }
.bd-lista-borrar:hover { opacity: 1; }

/* 02/10/2026: subhojas anidadas en la hoja (▸ en cada fila) */
.bd-sub-btn { border: 0; background: none; cursor: pointer; padding: 0 0.2rem; font-size: 0.85rem; color: var(--accent); }
.bd-sub-celda { padding: 0.3rem 0.5rem 0.6rem !important; background: var(--bg); }
.bd-sub { border-left: 3px solid var(--accent); padding-left: 0.6rem; margin: 0.3rem 0; }
.bd-sub-titulo { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.2rem; }
.bd-sub-vacio { margin: 0; font-size: 0.8rem; }
.bd-sub-tabla { border-collapse: collapse; font-size: 0.8rem; background: var(--card-bg); }
.bd-sub-tabla th, .bd-sub-tabla td { border: 1px solid var(--border); padding: 0.15rem 0.5rem; white-space: nowrap; }
.bd-sub-tabla th { background: var(--bg); font-weight: 600; text-align: left; }
.bd-sub-tabla td.bd-num { text-align: right; }
.bd-sub-num { width: 1.4rem; text-align: center; }
/* 03/10/2026, pedido de Javi: un poco de aire entre los botones y la tabla */
.bd-hoja-scroll { margin-top: 12px; }
/* 04/10/2026: grupos editables en la lista del Diagrama */
.bd-grupo-edit { display: inline-flex; gap: 2px; margin-left: 4px; }
.bd-grupo-edit button { font-size: 0.75rem; padding: 0 4px; line-height: 1.4; }
.bd-grupos-msg { font-size: 0.8rem; margin-left: 6px; }
.schema-domain-heading.bd-soltar { outline: 2px dashed #2f5bea; outline-offset: 2px; background: rgba(47, 91, 234, 0.08); }
.bd-arrastrando .schema-domain-heading { outline: 1px dashed rgba(47, 91, 234, 0.45); }
.schema-entity-item[draggable="true"] { cursor: grab; }
.bd-grupo-detalle { margin-top: 0.5rem; font-size: 0.85rem; }

/* 17/10/2026: dentro del marco de Conocimiento — sin cabecera «Atlas» y menos márgenes */
html.bd-incrustada .app-header { display: none; }
html.bd-incrustada main { padding: 0.5rem 0.9rem 1rem; }
html.bd-incrustada body.bd-ancho main { max-width: none; }
body.bd-completo main { padding-top: 0.6rem; }
body.bd-completo .schema-sidebar { flex: 0 0 230px; max-width: 230px; }

/* 17/10/2026 (Javi: «letra un poco más grande y negra; menos espacios en blanco») */
@media (prefers-color-scheme: light) { :root:not([data-tema="oscuro"]) { --fg: #0d1610; --muted: #2e3a32; } }
:root[data-tema="claro"] { --fg: #0d1610; --muted: #2e3a32; }
html { font-size: 17px; }
.schema-db-info { color: var(--fg); }
html.bd-incrustada main { padding: 0.35rem 0.75rem 0.5rem; }
html.bd-incrustada main > p:first-child { margin: 0 0 0.2rem; }
html.bd-incrustada .bd-cabecera { margin-bottom: 0.3rem; gap: 0.5rem; }
html.bd-incrustada h1 { font-size: 1.35rem; }
html.bd-incrustada .schema-db-info { margin: 0 0 0.35rem; font-size: 0.9rem; }
html.bd-incrustada main > p:first-child { display: none; }
html.bd-incrustada body.bd-completo h1#titulo { display: none; }
html.bd-incrustada body.bd-completo .bd-cabecera { justify-content: flex-end; }
html.bd-incrustada .schema-db-info { display: none; }

/* 17/10/2026: grupo «Sin clasificar» (tablas sin grupo): resaltado y número intermitente */
.schema-domain-heading.bd-sin-clasificar { color: #b42318; }
.schema-domain-heading.bd-sin-clasificar .bd-grupo-cuenta {
  color: #fff; background: #d92d20; border-radius: 999px; padding: 0 0.5em; font-weight: 700;
  animation: bd-parpadeo 1.1s ease-in-out infinite;
}
@keyframes bd-parpadeo { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 23/10/2026: base «Atlas» en vivo, solo para mirar (ver marcarBaseEnVivo en comun.js). */
.bd-vivo #btn-importar, .bd-vivo #importar-tablas, .bd-vivo #nueva-tabla, .bd-vivo .bd-pasos, .bd-vivo #origen,
.bd-vivo #dg-importar-tablas, .bd-vivo #dg-nueva-tabla, .bd-vivo .bd-lista-borrar, .bd-vivo .bd-borrar-tabla, .bd-vivo [data-borrar-tabla] { display: none !important; }
.bd-vivo-aviso { margin: 8px 0 12px; padding: 8px 12px; border-radius: 8px; background: #fff7e0; border: 1px solid #f0c040; color: #5a4300; font-size: 0.9rem; }
.badge-vivo { background: #fff7e0; color: #5a4300; border: 1px solid #f0c040; }

/* 23/10/2026: grupos de campos en la hoja (como en COBOL) */
.bd-hoja-tabla .bd-hoja-fila-grupos th { padding: 3px 6px; font-weight: 700; text-align: left; border-bottom: 1px solid #dfe5e1; }
.bd-hoja-tabla .bd-hoja-th-sin-grupo { background: transparent; }
.bd-hoja-grupo-btn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 2px 4px; text-align: left; }
.bd-hoja-grupo-n { font-weight: 500; opacity: .75; }
.bd-hoja-th-resumen { background: #f6f8f7; font-style: italic; }
.bd-celda-resumen { color: #46524b; font-style: italic; cursor: pointer; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.bd-panel-grupo { margin: 6px 0; padding: 10px 12px; border: 1px solid #c9d2cc; border-radius: 10px; background: #fbfcfb; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bd-pg-fila { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; width: 100%; }
.bd-pg-campos { display: flex; flex-wrap: wrap; gap: 4px 14px; width: 100%; max-height: 180px; overflow: auto; padding: 4px 0; }
.bd-pg-campo { white-space: nowrap; }
/* con varios pisos de cabecera, se queda fija la cabecera entera (no cada fila por su cuenta) */
.bd-hoja-tabla thead { position: sticky; top: 0; z-index: 3; background: var(--bg); }
.bd-hoja-tabla thead th { position: relative; top: auto; }
.bd-hoja-tabla thead th.bd-hoja-esquina { position: sticky; left: 0; z-index: 4; }
/* 23/10/2026: grupos de campos en la ficha de la tabla */
.bd-ficha-grupo td { background: rgba(47, 125, 85, 0.07); }
.bd-ficha-grupo-btn { background: none; border: 0; font: inherit; font-weight: 700; color: #1f5c3d; cursor: pointer; padding: 2px 0; }
