:root { --fondo:   #f4f6fb; --panel:   #ffffff; --linea:   #d7dceb; --texto:   #1f2937; --muted:   #6b7280; --acento:  #2563eb; --peligro: #dc2626; --ok:      #059669; --lienzo:  #ffffff; --sombra:  0 10px 25px rgba(0,0,0,.08); }
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--fondo); color: var(--texto); overflow: hidden; }
.sidebar { width: 300px; background: #0f1520; color: #e8edf5; display: flex; flex-direction: column; padding: 0; border-right: 1px solid rgba(255,255,255,0.08); overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar-brand-badge { margin-left:auto; display:inline-flex; align-items:center; gap:5px; background:rgba(16,185,129,0.10); color:#34d399; border:1px solid rgba(52,211,153,0.18); border-radius:20px; padding:3px 8px; font-size:10px; font-weight:600; flex-shrink:0; }
.badge-dot { width:5px; height:5px; border-radius:50%; background:#34d399; flex-shrink:0; }
.section { margin-bottom:0; padding:14px 14px 0; }
.section:last-of-type { padding-bottom:14px; }
.section h2 { font-size:10px; text-transform:uppercase; letter-spacing:1.2px; color:#7a8fa3; font-weight:700; margin:0 0 9px; display:flex; align-items:center; gap:7px; }
.section h2::after { content:''; flex:1; height:1px; background:rgba(255,255,255,0.09); }
.btn { background: rgba(255,255,255,0.06); color: #dde5f0; border: 1px solid rgba(255,255,255,0.10); padding:9px 10px; border-radius:8px; font-size:12px; cursor:pointer; transition:background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s; text-align:center; }
.btn:hover { background:rgba(255,255,255,0.11); border-color:rgba(255,255,255,0.18); color:#ffffff; transform:translateY(-1px); }
.btn.active { background:rgba(37,99,235,0.28); border-color:rgba(59,130,246,0.55); color:#93c5fd; font-weight:700; box-shadow:0 0 0 2px rgba(37,99,235,0.15); }
.btn.danger { background:rgba(220,38,38,0.14); color:#fca5a5; border-color:rgba(248,113,113,0.25); }
.btn.danger:hover { background:rgba(220,38,38,0.26); border-color:rgba(248,113,113,0.45); color:#fecaca; }
.btn.primary { background:rgba(37,99,235,0.22); color:#93c5fd; border-color:rgba(59,130,246,0.35); font-weight:600; }
.btn.primary:hover { background:rgba(37,99,235,0.35); border-color:rgba(59,130,246,0.55); color:#bfdbfe; }
.btn.success { background:rgba(5,150,105,0.18); color:#6ee7b7; border-color:rgba(52,211,153,0.3); font-weight:600; }
.btn-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.btn.full { width:100%; margin-top:10px; }
.row { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.panel-box { background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.07); border-radius:10px; padding:11px; }
button, select, input, textarea { font: inherit; }
.sidebar input:not([type="checkbox"]), .sidebar select, .sidebar textarea { width:100%; margin-top:4px; margin-bottom:9px; padding:8px 10px; border-radius:7px; border:1px solid rgba(255,255,255,0.11); background:rgba(255,255,255,0.05); color:#e8edf5; font-size:12px; transition:border-color 0.15s, box-shadow 0.15s; }
.sidebar select option { background:#1a2233; color:#e8edf5; }
.sidebar input:not([type="checkbox"]):focus, .sidebar select:focus, .sidebar textarea:focus { outline:none; border-color:rgba(59,130,246,0.55); box-shadow:0 0 0 2px rgba(37,99,235,0.18); }
.sidebar input::placeholder { color:#4a5a6e; }
.sidebar label { display:block; font-size:11px; color:#8899aa; margin-bottom:2px; letter-spacing:0.2px; }
.label-checkbox { display:flex !important; align-items:center; gap:6px; font-size:12px !important; color:#aab8c8 !important; margin-bottom:4px !important; cursor:pointer; }
.sidebar input[type="checkbox"] { width:auto; margin:0; accent-color:#3b82f6; cursor:pointer; }
.small { font-size:11px; color:#7a8fa3; line-height:1.6; }
.hint { font-size:11px; color:#7a8fa3; margin-top:6px; line-height:1.7; }
.canvas-wrap { position: relative; overflow: auto; background: linear-gradient(to right,  rgba(37,99,235,.06) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(to bottom, rgba(37,99,235,.06) 1px, transparent 1px) 0 0 / 24px 24px, var(--lienzo); }
.status { font-size:13px; color:var(--muted); margin-left:4px; }
.svg-space { position:relative; width:5200px; height:3600px; }
svg { width:100%; height:100%; display:block; user-select:none; -webkit-user-select:none; overflow:visible; }
.grupo-figura { cursor: move; }
.grupo-figura.selected .main-shape, .grupo-figura.selected .shape-body, .grupo-figura.multi-selected .main-shape, .grupo-figura.multi-selected .shape-body, .connection.selected .conn-line, .connection.selected .conn-hit { stroke: var(--acento) !important; stroke-width: 2.8; }
.entity .shape-body { fill:#e0f2fe; stroke:#111827; stroke-width:2; }
.entity-hija .shape-body { fill:#a8e3ba; stroke:#111827; stroke-width:2; }
.relationship .shape-body { fill:#fffef2; stroke:#92400e; stroke-width:2; }
.specialization .shape-body { fill:#f5f3ff; stroke:#5b21b6; stroke-width:2; }
.text-block .shape-body { fill:#ffffff; stroke:#9ca3af; stroke-width:1.2; }
.title-text { font-weight:bold; font-size:16px; }
.attr-text { font-size:14px; }
.text-content { font-size:24px; fill:#111827; dominant-baseline:hanging; white-space:pre; user-select:none; -webkit-user-select:none; }
.conn-line { stroke:#111827; stroke-width:2; fill:none; }
.conn-hit { stroke:transparent; stroke-width:16; fill:none; cursor:pointer; }
.conn-label { font-size:13px; fill:#111827; paint-order:stroke; stroke:white; stroke-width:3px; stroke-linejoin:round; }
.conn-handle { cursor: grab; transition: r 0.1s ease, fill 0.1s ease; }
.conn-handle:active { cursor: grabbing; }
.conn-handle-endpoint-from, .conn-handle-endpoint-to { fill: var(--acento); stroke: #ffffff; stroke-width: 2; }
.conn-handle-endpoint-from:hover, .conn-handle-endpoint-to:hover { fill: #1d4ed8; }
.conn-handle-vertex { fill: #ffffff; stroke: var(--acento); stroke-width: 2; }
.conn-handle-vertex:hover { fill: #dbeafe; }
.conn-handle-midpoint { fill: var(--acento); fill-opacity: 0.35; stroke: var(--acento); stroke-opacity: 0.55; stroke-width: 1.5; }
.conn-handle-midpoint:hover { fill-opacity: 0.85; stroke-opacity: 1; }
.ovalo-atributo-externo { fill:#ffffff; stroke:#374151; stroke-width:1.8; }
.linea-atributo-externo { stroke:#374151; stroke-width:1.5; fill:none; }
.grupo-atributo-externo.selected .ovalo-atributo-externo { stroke:var(--acento) !important; stroke-width:2.8 !important; }
.grupo-atributo-externo.selected .attr-text { fill:var(--acento) !important; font-weight:bold; }
.panel-box label { display:block; font-size:13px; margin-bottom:6px; color:var(--muted); }
.panel-box input, .panel-box textarea, .panel-box select { width:100%; border:1px solid var(--linea); border-radius:8px; padding:8px; margin-bottom:8px; background:#111827; }
.list { max-height:160px; overflow:auto; border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.04); border-radius:8px; padding:6px; }
.list-item { padding:6px 8px; border-radius:8px; cursor:pointer; font-size:14px; color:#c8d8e8; }
.list-item:hover, .list-item.active { background:rgba(37,99,235,0.25); color:#93c5fd; }
.subcard { border:1px solid rgba(255,255,255,0.1); border-radius:10px; padding:8px; margin-bottom:8px; background:rgba(255,255,255,0.05); }
.subcard-title { font-size:13px; font-weight:bold; margin-bottom:6px; color:#93c5fd; }
.mini-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.attr-header { display:flex; justify-content:space-between; align-items:center; margin:8px 0; }
.attr-card { background:#f8fafc; border:1px solid #cbd5e1; border-radius:10px; padding:8px; margin-bottom:8px; }
.attr-row-top { display:grid; grid-template-columns:1fr 130px; gap:6px; margin-bottom:6px; }
.attr-row-bottom { display:flex; justify-content:space-between; align-items:center; }
.attr-input { width:100%; padding:4px 6px; border-radius:6px; border:1px solid rgba(255,255,255,0.15); background:#1a2233; color:#e8edf5; }
.attr-select { width:100%; border-radius:6px; background:#1a2233; color:#e8edf5; border:1px solid rgba(255,255,255,0.15); }
.attr-select option { background:#1a2233; color:#e8edf5; }
.attr-meta { font-size:11px; color:#64748b; }
.attr-actions { display:flex; align-items:center; gap:4px; }
.attr-pk { display:flex; align-items:center; gap:3px; font-size:12px; }
.btn.icon { min-width:28px; padding:2px 4px; }
.btn.small { padding:2px 6px; }
.inline-rename-editor { position:fixed; z-index:2000; pointer-events:auto; }
.inline-rename-input { width:100%; min-height:42px; padding:10px 12px; border-radius:12px; border:2px solid var(--acento); background:rgba(255,255,255,.98); box-shadow:0 12px 28px rgba(37,99,235,.18); color:var(--texto); outline:none; resize:both; }
textarea.inline-rename-input { min-height:88px; line-height:1.35; resize:both; }
.rename-modal-overlay { position:fixed; inset:0; z-index:3000; background:rgba(15,23,42,0.18); display:flex; align-items:center; justify-content:center; padding:20px; backdrop-filter:blur(2px); }
.rename-modal-dialog { width:min(460px,calc(100vw - 32px)); background:#ffffff; border:1px solid #dbe4f0; border-radius:18px; box-shadow:0 24px 60px rgba(15,23,42,0.22); overflow:hidden; }
.rename-modal-header, .rename-modal-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; }
.rename-modal-header { border-bottom:1px solid #e5e7eb; }
.rename-modal-footer { justify-content:flex-end; border-top:1px solid #e5e7eb; }
.rename-modal-title { font-size:18px; font-weight:700; color:var(--texto); }
.rename-modal-close { width:34px; height:34px; border-radius:10px; border:1px solid #d1d5db; background:#fff; cursor:pointer; font-size:16px; }
.rename-modal-close:hover { background:#f8fafc; }
.rename-modal-body { padding:16px; }
.rename-modal-hint { margin-bottom:10px; font-size:13px; color:var(--muted); line-height:1.4; }
.rename-modal-input { width:100%; min-height:46px; padding:12px 14px; border-radius:12px; border:2px solid #bfdbfe; background:#fff; color:var(--texto); outline:none; font-size:15px; box-sizing:border-box; }
.rename-modal-input:focus { border-color:var(--acento); box-shadow:0 0 0 4px rgba(37,99,235,0.12); }
textarea.rename-modal-input { min-height:120px; resize:vertical; line-height:1.4; }
.help-modal.hidden { display:none; }
.help-modal { position:fixed; inset:0; z-index:3000; }
.help-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.45); }
.help-modal-dialog { position:relative; width:min(760px,calc(100vw - 32px)); max-height:calc(100vh - 40px); margin:20px auto; background:#fff; border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.25); display:flex; flex-direction:column; overflow:hidden; }
.help-modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #e5e7eb; background:#f8fafc; }
.help-modal-header h2 { margin:0; font-size:20px; color:#111827; }
.help-modal-close { border:none; background:transparent; cursor:pointer; font-size:18px; color:#374151; padding:6px; border-radius:8px; }
.help-modal-close:hover { background:#e5e7eb; }
.help-modal-body { padding:20px; overflow:auto; color:#111827; line-height:1.55; }
.help-modal-body p { margin:0 0 14px; }
.help-modal-body ul { margin:0 0 14px 20px; padding:0; }
.help-modal-body li { margin-bottom:6px; }
.help-modal-footer { display:flex; justify-content:flex-end; gap:10px; padding:14px 20px; border-top:1px solid #e5e7eb; background:#f8fafc; }
.hidden { display:none !important; }
.modal-overlay { position:fixed; inset:0; z-index:3000; background:rgba(15,23,42,0.4); display:flex; align-items:center; justify-content:center; }
.modal-dialog { width:min(460px,calc(100vw - 32px)); background:#fff; border:1px solid #dbe4f0; border-radius:16px; box-shadow:0 20px 60px rgba(15,23,42,.22); overflow:hidden; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #e5e7eb; }
.modal-title { font-size:16px; font-weight:700; color:var(--texto); }
.modal-close { width:32px; height:32px; border-radius:8px; border:1px solid #d1d5db; background:#fff; cursor:pointer; font-size:15px; }
.modal-close:hover { background:#f8fafc; }
.modal-body { padding:16px; }
.modal-label { display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
.modal-input, .modal-select { width:100%; padding:8px 10px; border-radius:8px; border:1.5px solid #bfdbfe; font-size:13px; outline:none; color:var(--texto); margin-bottom:10px; background:#fff; }
.modal-input:focus, .modal-select:focus { border-color:var(--acento); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.modal-checks { display:flex; gap:16px; margin-bottom:4px; }
.modal-check { display:flex; align-items:center; gap:5px; font-size:12px; color:#555; cursor:pointer; }
.modal-check input { accent-color:var(--acento); }
.modal-footer { display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid #e5e7eb; }
.modal-btn { padding:7px 18px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; border:1px solid transparent; }
.modal-btn.cancel { background:transparent; border-color:#d1d5db; color:#555; }
.modal-btn.cancel:hover { background:#f5f5f5; }
.modal-btn.ok { background:var(--acento); color:white; border-color:var(--acento); }
.modal-btn.ok:hover { background:#1d4ed8; }
.sidebar { width: 264px !important; background: #053a61 !important; color: #cfe6f5 !important; border-right: 1px solid rgba(0,192,243,.14) !important; transition: width .2s ease; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,192,243,.18) !important; }
.sidebar-brand-badge { background: rgba(0,192,243,.12) !important; color: #7fd6f5 !important; border-color: rgba(0,192,243,.22) !important; }
.badge-dot { background: #00c0f3 !important; }
.section h2 { color: #5d8fb3 !important; }
.section h2::after { background: rgba(0,192,243,.14) !important; }
.btn { background: rgba(0,192,243,.07) !important; color: #dbeaf6 !important; border-color: rgba(0,192,243,.16) !important; }
.btn:hover { background: rgba(0,192,243,.14) !important; border-color: rgba(0,192,243,.32) !important; color: #fff !important; }
.btn.active { background: rgba(0,192,243,.20) !important; border-color: rgba(0,192,243,.55) !important; color: #fff !important; }
.btn.danger { background: rgba(178,58,46,.20) !important; color: #f4b9b3 !important; border-color: rgba(178,58,46,.4) !important; }
.btn.danger:hover { background: rgba(178,58,46,.35) !important; color: #fff !important; }
.btn.primary { background: rgba(0,93,164,.32) !important; color: #dcefff !important; border-color: rgba(0,93,164,.5) !important; }
.btn.primary:hover { background: rgba(0,93,164,.46) !important; color: #fff !important; }
.btn.success { background: rgba(63,154,64,.24) !important; color: #cdeccd !important; border-color: rgba(63,154,64,.45) !important; }
.btn.success:hover { background: rgba(63,154,64,.4) !important; color: #fff !important; }
.panel-box { background: rgba(0,192,243,.05) !important; border-color: rgba(0,192,243,.12) !important; }
.small, .hint { color: #8fb2c9 !important; }
.hint b { color: #7fd6f5 !important; }
.sidebar input:not([type="checkbox"]), .sidebar select, .sidebar textarea { background: rgba(0,192,243,.06) !important; color: #eaf6ff !important; border-color: rgba(0,192,243,.18) !important; }
.sidebar input:not([type="checkbox"]):focus, .sidebar select:focus, .sidebar textarea:focus { border-color: rgba(0,192,243,.6) !important; box-shadow: 0 0 0 2px rgba(0,192,243,.18) !important; }
.sidebar select option { background: #0a2c48; color: #eaf6ff; }
.sidebar label { color: #8fb2c9 !important; }
.sidebar input[type="checkbox"] { accent-color: #00c0f3; }
.app { display: grid; grid-template-columns: auto 1fr; flex: 1; min-height: 0; height: auto; }
.app.sin-panel { grid-template-columns: 1fr; }
.app.sin-panel > .sidebar { display: none !important; }
.sidebar { height: 100%; }
.su-modo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5d8fb3; }
.su-modo .sidebar-brand-badge { margin-left: 0; text-transform: none; letter-spacing: normal; }
