/* BieuMau — giao diện điền đơn overlay */
.bm-root { display:flex; flex-direction:column; align-items:center; gap:18px; }
.bm-page {
  position:relative; background:#fff; box-shadow:0 2px 14px rgba(0,0,0,.18);
  border-radius:4px; overflow:hidden;
}
.bm-canvas { display:block; }

/* ô nhập */
.bm-field { position:absolute; box-sizing:border-box; }
.bm-input {
  width:100%; height:100%; box-sizing:border-box; border:0;
  padding:0 2px; margin:0; background:rgba(240,170,70,.15);
  outline:1px solid rgba(212,145,45,.65); color:#5a3a12;
  font-family:'Malgun Gothic','Nanum Gothic',sans-serif; line-height:1;
}
.bm-input:focus { background:rgba(240,170,70,.28); outline:2px solid #e08a2b; }
textarea.bm-input { line-height:1.25; resize:none; padding:2px; }

.bm-check {
  display:flex; align-items:center; justify-content:center;
  background:rgba(240,170,70,.15); outline:1px solid rgba(212,145,45,.65);
  border-radius:2px;
}
.bm-check:focus-within { background:rgba(240,170,70,.28); outline:2px solid #e08a2b; }
.bm-checkbox { width:100%; height:100%; margin:0; cursor:pointer; accent-color:#e08a2b; }

/* nhãn tiếng Việt nổi trên ô */
.bm-label {
  position:absolute; left:0; bottom:100%; margin-bottom:2px;
  font:600 10px/1.2 system-ui,sans-serif; white-space:nowrap;
  background:#1e6fdc; color:#fff; padding:1px 5px; border-radius:3px;
  opacity:0; transform:translateY(3px); transition:.12s; pointer-events:none;
  box-shadow:0 1px 4px rgba(0,0,0,.2); z-index:5;
}
.bm-field:hover .bm-label,
.bm-field:focus-within .bm-label { opacity:1; transform:none; }

/* chế độ admin */
.bm-edit .bm-field { cursor:move; }
.bm-edit .bm-input { pointer-events:none; }
.bm-edit .bm-label { opacity:1; transform:none; }
.bm-selected { outline:2px dashed #e0532d !important; z-index:20; }
.bm-selected .bm-input, .bm-selected.bm-check { outline:2px dashed #e0532d; }
.bm-resize {
  position:absolute; right:-5px; bottom:-5px; width:11px; height:11px;
  background:#e0532d; border:2px solid #fff; border-radius:50%; cursor:nwse-resize; z-index:21;
}
.bm-check .bm-resize { display:none; }

/* nút AI trên ô tự luận (D-10 kế hoạch...) */
.bm-ai {
  position:absolute; right:-2px; top:-20px; z-index:6;
  font:600 10px/1 system-ui,sans-serif; cursor:pointer;
  background:linear-gradient(135deg,#7b3ff2,#c13ffb); color:#fff;
  border:0; padding:3px 7px; border-radius:4px; box-shadow:0 1px 4px rgba(0,0,0,.25);
}
.bm-ai:hover { filter:brightness(1.08); }
