body {
    margin: 0;
    padding: 20px;
    background: #05070d;
    font-family: Arial, sans-serif;
    color: #fff;
}

button {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #2ecbff;
    color: #000;
    font-weight: bold;
}

.btn-save { background: #2ecc71; }
.btn-open { background: #f1c40f; }

#canvas {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
}

/* SVG RELATION LINES */
#relations {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.table {
    position: absolute;
    width: 260px;
    background: #050505;
    border: 2px solid #2ecbff;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(46,203,255,.6);
    cursor: grab;
    z-index: 1;
}

.table-header {
    background: linear-gradient(135deg,#2ecbff,#0066ff);
    padding: 10px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
}

.field {
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 13px;
}

.pk { color: gold; }

.relation {
    font-size: 11px;
    color: #2ecbff;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: #fff;
    color: #000;
    padding: 20px;
    width: 520px;
    border-radius: 10px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

input, select {
    width: 100%;
    padding: 6px;
}

.close {
    float: right;
    cursor: pointer;
}
