/* ---------- Diagramas ER: notaciones (las medidas deben coincidir con public/js/er/svg.js) ---------- */

/* Decoraciones y etiquetas de las relaciones */
.edges text { stroke: none; pointer-events: none; }
.edge .line.dashed { stroke-dasharray: 7 5; }
.edge .mark.fbg { fill: var(--bg); }
.edge .mark.fln, .edge circle.fln { fill: var(--edge); }
.edge:hover .mark.fln, .edge:hover circle.fln,
.edge.related .mark.fln, .edge.related circle.fln,
.edge.selected .mark.fln, .edge.selected circle.fln { fill: var(--edge-hl); }
.edge .elabel { fill: var(--muted); font-size: 11px; font-weight: 600; }
.edge .elabel.role { font-weight: 400; font-style: italic; }
.edge:hover .elabel, .edge.related .elabel, .edge.selected .elabel { fill: var(--edge-hl); }

/* UML: estereotipo sobre el nombre y atributos "+ nombre : TIPO {PK}" */
.tnode.n-uml .thead { height: 50px; flex-direction: column; justify-content: center; align-items: center; gap: 0; }
.n-uml .ster { font-size: 11px; font-weight: 400; line-height: 16px; color: var(--muted); }
.n-uml .tname { flex: none; max-width: 100%; line-height: 16px; text-align: center; }
.n-uml .tcol { gap: 4px; }
.uvis { width: 8px; flex: none; color: var(--muted); }
.n-uml .cname.pk { font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.n-uml .ctype { max-width: 100px; }
.uprops { flex: none; font-size: 10.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* IDEF1X: nombre fuera de la caja, clave primaria arriba; esquinas redondeadas si la entidad es dependiente */
.tnode.n-idef1x { background: transparent; border: 0; border-radius: 0; }
.tnode.n-idef1x, .tnode.n-idef1x.selected, .tnode.n-idef1x.remote-sel, .tnode.n-idef1x.dragging { box-shadow: none; }
.ix-name {
  height: 24px; line-height: 24px; padding: 0 2px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ix-name i { font-weight: 400; color: var(--faint); }
.ix-box {
  background: var(--node-bg); border: 1px solid var(--border-strong); border-top: 3px solid var(--c);
  border-radius: 0; box-shadow: var(--shadow);
}
.ix-box.dep { border-radius: 12px; }
.ix-keys { min-height: 12px; border-bottom: 1px solid var(--border-strong); }
.ix-attrs { min-height: 12px; }
.n-idef1x .cname.pk { font-weight: 400; }
.ixfk { color: var(--muted); }
.n-idef1x.dragging .ix-box { box-shadow: var(--shadow-lg); }
.n-idef1x.selected .ix-box { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.n-idef1x.remote-sel .ix-box { box-shadow: 0 0 0 2px var(--rc), var(--shadow); }
.n-idef1x.selected.remote-sel .ix-box { box-shadow: 0 0 0 2px var(--c), 0 0 0 5px var(--rc), var(--shadow); }

/* Chen: entidades, atributos (elipses) y relaciones (rombos) */
.tnode.n-chen {
  width: 150px; height: 46px; padding: 0 8px; border-radius: 3px; border-top: 4px solid var(--c);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 10%, var(--node-bg)); font-weight: 700;
}
.n-chen .tname { flex: none; max-width: 100%; text-align: center; }
.chen-link { stroke: var(--edge); stroke-width: 1.3; fill: none; }
.chen-attr { cursor: grab; }
.readonly .chen-attr { cursor: default; }
.chen-ell { fill: var(--node-bg); stroke: var(--edge); stroke-width: 1.4; }
.chen-ell.fk { stroke-dasharray: 5 4; }
.chen-ell.hl { fill: var(--accent-soft); stroke: var(--edge-hl); }
.chen-attr:hover .chen-ell, .chen-attr.sel .chen-ell { stroke: var(--edge-hl); }
.chen-txt { fill: var(--text); font-size: 12px; }
.chen-txt.pk { font-weight: 600; }
.chen-ul { stroke: var(--text); stroke-width: 1; fill: none; }
.chen-dia { fill: var(--node-bg); stroke: var(--edge); stroke-width: 1.6; cursor: pointer; }
.chen-dlabel { fill: var(--text); font-size: 11px; font-weight: 600; }
.edge:hover .chen-dia, .edge.related .chen-dia { stroke: var(--edge-hl); }
.edge.selected .chen-dia { stroke: var(--edge-hl); stroke-width: 2.4; }
